diff options
Diffstat (limited to 'test/web/node_info_test.exs')
-rw-r--r-- | test/web/node_info_test.exs | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/test/web/node_info_test.exs b/test/web/node_info_test.exs index a6376453c..5981c70a7 100644 --- a/test/web/node_info_test.exs +++ b/test/web/node_info_test.exs @@ -1,10 +1,14 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/> +# SPDX-License-Identifier: AGPL-3.0-only + 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}}) + user = insert(:user, %{local: true, info: %{is_moderator: true}}) conn = conn @@ -15,7 +19,18 @@ defmodule Pleroma.Web.NodeInfoTest do assert user.ap_id in result["metadata"]["staffAccounts"] end - test "returns 404 when federation is disabled" do + test "nodeinfo shows restricted nicknames", %{conn: conn} do + conn = + conn + |> get("/nodeinfo/2.0.json") + + assert result = json_response(conn, 200) + + assert Pleroma.Config.get([Pleroma.User, :restricted_nicknames]) == + result["metadata"]["restrictedNicknames"] + end + + test "returns 404 when federation is disabled", %{conn: conn} do instance = Application.get_env(:pleroma, :instance) |> Keyword.put(:federating, false) @@ -37,7 +52,7 @@ defmodule Pleroma.Web.NodeInfoTest do Application.put_env(:pleroma, :instance, instance) end - test "returns 200 when federation is enabled" do + test "returns 200 when federation is enabled", %{conn: conn} do conn |> get("/.well-known/nodeinfo") |> json_response(200) |