summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIlja <ilja@ilja.space>2022-06-18 08:32:05 +0200
committerIlja <ilja@ilja.space>2022-06-21 12:10:27 +0200
commitedf0013ff38ae2d7bc84431d1d1384e5fc45bc0e (patch)
tree410ce2131fe7e050608d07f1a1d2987127220947 /test
parentbb61cfee8dc27c658215f05cce3ea58fca5b3db3 (diff)
downloadpleroma-edf0013ff38ae2d7bc84431d1d1384e5fc45bc0e.tar.gz
pleroma-edf0013ff38ae2d7bc84431d1d1384e5fc45bc0e.zip
User.visible_for/2
According to the tests, this was only used for unconfirmed accounts. So this just needed to be restricted to users with privilege :user_activation
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/user_test.exs7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs
index 192bffaa9..22d55cd53 100644
--- a/test/pleroma/user_test.exs
+++ b/test/pleroma/user_test.exs
@@ -1986,13 +1986,18 @@ defmodule Pleroma.UserTest do
assert User.visible_for(user, other_user) == :visible
end
- test "returns true when the account is unconfirmed and being viewed by a privileged account (confirmation required)" do
+ test "returns true when the account is unconfirmed and being viewed by a privileged account (privilege :user_activation, confirmation required)" do
clear_config([:instance, :account_activation_required], true)
+ clear_config([:instance, :admin_privileges], [:user_activation])
user = insert(:user, local: true, is_confirmed: false)
other_user = insert(:user, local: true, is_admin: true)
assert User.visible_for(user, other_user) == :visible
+
+ clear_config([:instance, :admin_privileges], [])
+
+ refute User.visible_for(user, other_user) == :visible
end
end