diff options
author | lain <lain@soykaf.club> | 2019-03-22 11:57:20 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-03-22 11:57:20 +0100 |
commit | e2afce34b68d88ec8e1ff624fe0a245fd0726fee (patch) | |
tree | d32988cfc1c135f37ec87451b5addc75809131ba /test/web/node_info_test.exs | |
parent | bf27190f7f0942a05de518f2085a299eb011614c (diff) | |
download | pleroma-e2afce34b68d88ec8e1ff624fe0a245fd0726fee.tar.gz |
NodeInfo: Return safe_dm_mentions feature flag.
Diffstat (limited to 'test/web/node_info_test.exs')
-rw-r--r-- | test/web/node_info_test.exs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/web/node_info_test.exs b/test/web/node_info_test.exs index 038feecc1..2fc42b7cc 100644 --- a/test/web/node_info_test.exs +++ b/test/web/node_info_test.exs @@ -108,4 +108,27 @@ defmodule Pleroma.Web.NodeInfoTest do assert result = json_response(conn, 200) assert Pleroma.Application.repository() == result["software"]["repository"] end + + test "it returns the safe_dm_mentions feature if enabled", %{conn: conn} do + option = Pleroma.Config.get([:instance, :safe_dm_mentions]) + Pleroma.Config.put([:instance, :safe_dm_mentions], true) + + response = + conn + |> get("/nodeinfo/2.1.json") + |> json_response(:ok) + + assert "safe_dm_mentions" in response["metadata"]["features"] + + Pleroma.Config.put([:instance, :safe_dm_mentions], false) + + response = + conn + |> get("/nodeinfo/2.1.json") + |> json_response(:ok) + + refute "safe_dm_mentions" in response["metadata"]["features"] + + Pleroma.Config.put([:instance, :safe_dm_mentions], option) + end end |