summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIlja <ilja@ilja.space>2022-06-21 12:03:35 +0200
committerIlja <ilja@ilja.space>2022-06-21 12:10:27 +0200
commit4e4eb81749076ada5692b92061c77a72832a9cc8 (patch)
tree5e7c83beabf4056d446e044c66c5e4cfa59806bc /test
parent211e561e2ad862c75a1b34f783d3210523dc211e (diff)
downloadpleroma-4e4eb81749076ada5692b92061c77a72832a9cc8.tar.gz
pleroma-4e4eb81749076ada5692b92061c77a72832a9cc8.zip
Add nodes and privileges to nodeinfo
I didn't add it to /api/v1/instance I was wondering if I should, but since it e.g. also didn't show staff, it felt better not to
Diffstat (limited to 'test')
-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