tests: user: add regression test for remote_or_auth_active?/1
This commit is contained in:
parent
595a970493
commit
4124c9aa4a
|
@ -767,4 +767,18 @@ test "finds a user whose name is nil" do
|
||||||
|> Map.put(:search_distance, nil)
|
|> Map.put(:search_distance, nil)
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
Loading…
Reference in New Issue