Commit 4124c9aa authored by kaniini's avatar kaniini
Browse files

tests: user: add regression test for remote_or_auth_active?/1

parent 595a9704
Pipeline #6086 passed with stages
in 3 minutes and 19 seconds
......@@ -767,4 +767,18 @@ test "finds a user whose name is nil" do
|> Map.put(:search_distance, nil)
end
end
test "remote_or_auth_active?/1 works correctly" do
Pleroma.Config.put([:instance, :account_activation_required], true)
local_user = insert(:user, local: true, info: %{confirmation_pending: true})
confirmed_user = insert(:user, local: true, info: %{confirmation_pending: false})
remote_user = insert(:user, local: false)
refute User.remote_or_auth_active?(local_user)
assert User.remote_or_auth_active?(confirmed_user)
assert User.remote_or_auth_active?(remote_user)
Pleroma.Config.put([:instance, :account_activation_required], false)
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment