tests: add test for staffAccounts presence in nodeinfo
authorWilliam Pitcock <nenolod@dereferenced.org>
Mon, 3 Sep 2018 14:40:14 +0000 (14:40 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Mon, 3 Sep 2018 14:48:36 +0000 (14:48 +0000)
test/web/node_info_test.exs [new file with mode: 0644]

diff --git a/test/web/node_info_test.exs b/test/web/node_info_test.exs
new file mode 100644 (file)
index 0000000..d48f40e
--- /dev/null
@@ -0,0 +1,17 @@
+defmodule Pleroma.Web.NodeInfoTest do
+  use Pleroma.Web.ConnCase
+
+  import Pleroma.Factory
+
+  test "nodeinfo shows staff accounts", %{conn: conn} do
+    user = insert(:user, %{local: true, info: %{"is_moderator" => true}})
+
+    conn =
+      conn
+      |> get("/nodeinfo/2.0.json")
+
+    assert result = json_response(conn, 200)
+
+    assert user.ap_id in result["metadata"]["staffAccounts"]
+  end
+end