diff options
author | William Pitcock <nenolod@dereferenced.org> | 2019-01-09 05:02:00 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2019-01-09 06:02:18 +0000 |
commit | 4124c9aa4aae4622f7a939caa84f01ca0760057c (patch) | |
tree | 19360389e418d2dbf08e30eef0a636989db3c28d | |
parent | 595a970493a9bae0dcc4b84de338766c2cc61a75 (diff) | |
download | pleroma-4124c9aa4aae4622f7a939caa84f01ca0760057c.tar.gz |
tests: user: add regression test for remote_or_auth_active?/1
-rw-r--r-- | test/user_test.exs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/user_test.exs b/test/user_test.exs index 74accb7c8..419a576dc 100644 --- a/test/user_test.exs +++ b/test/user_test.exs @@ -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 |