summaryrefslogtreecommitdiff
path: root/test/pleroma/web/node_info_test.exs
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2022-12-23 13:48:07 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2022-12-23 13:48:07 +0000
commit718ff64c3b77fae0479ce2b829a6f7148728b27c (patch)
tree5f10d800c9bfbbbe3909e6cacc80c23b156d6490 /test/pleroma/web/node_info_test.exs
parent5910d58cf7f468722b3774622b6b40a07b5d6444 (diff)
parent90681c720d4c0530b67b0105db1204fff82835d8 (diff)
downloadpleroma-718ff64c3b77fae0479ce2b829a6f7148728b27c.tar.gz
pleroma-718ff64c3b77fae0479ce2b829a6f7148728b27c.zip
Merge branch 'fine_grained_moderation_privileges' into 'develop'
fine grained moderation privileges (continued) See merge request pleroma/pleroma!3812
Diffstat (limited to 'test/pleroma/web/node_info_test.exs')
-rw-r--r--test/pleroma/web/node_info_test.exs15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/pleroma/web/node_info_test.exs b/test/pleroma/web/node_info_test.exs
index 247ad7501..f474220be 100644
--- a/test/pleroma/web/node_info_test.exs
+++ b/test/pleroma/web/node_info_test.exs
@@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.NodeInfoTest do
- use Pleroma.Web.ConnCase
+ use Pleroma.Web.ConnCase, async: false
import Pleroma.Factory
@@ -40,6 +40,19 @@ defmodule Pleroma.Web.NodeInfoTest do
assert admin.ap_id in result["metadata"]["staffAccounts"]
end
+ test "nodeinfo shows roles and privileges", %{conn: conn} do
+ clear_config([:instance, :moderator_privileges], [:cofe])
+ clear_config([:instance, :admin_privileges], [:suya, :cofe])
+
+ conn =
+ conn
+ |> get("/nodeinfo/2.1.json")
+
+ assert result = json_response(conn, 200)
+
+ assert %{"admin" => ["suya", "cofe"], "moderator" => ["cofe"]} == result["metadata"]["roles"]
+ end
+
test "nodeinfo shows restricted nicknames", %{conn: conn} do
conn =
conn