1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.NodeInfoTest do
6 use Pleroma.Web.ConnCase
10 test "nodeinfo shows staff accounts", %{conn: conn} do
11 user = insert(:user, %{local: true, info: %{is_moderator: true}})
15 |> get("/nodeinfo/2.0.json")
17 assert result = json_response(conn, 200)
19 assert user.ap_id in result["metadata"]["staffAccounts"]
22 test "returns 404 when federation is disabled", %{conn: conn} do
24 Application.get_env(:pleroma, :instance)
25 |> Keyword.put(:federating, false)
27 Application.put_env(:pleroma, :instance, instance)
30 |> get("/.well-known/nodeinfo")
34 |> get("/nodeinfo/2.0.json")
38 Application.get_env(:pleroma, :instance)
39 |> Keyword.put(:federating, true)
41 Application.put_env(:pleroma, :instance, instance)
44 test "returns 200 when federation is enabled", %{conn: conn} do
46 |> get("/.well-known/nodeinfo")
50 |> get("/nodeinfo/2.0.json")