Skip to content
Snippets Groups Projects
Commit 4124c9aa authored by kaniini's avatar kaniini
Browse files

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

parent 595a9704
No related branches found
No related tags found
No related merge requests found
......@@ -767,4 +767,18 @@ defmodule Pleroma.UserTest 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment