summaryrefslogtreecommitdiff
path: root/test/web/node_info_test.exs
diff options
context:
space:
mode:
authorIvan Tashkinov <ivant.business@gmail.com>2019-04-02 09:19:10 +0300
committerIvan Tashkinov <ivant.business@gmail.com>2019-04-02 09:19:10 +0300
commitaac48d0cc6893c231c88d5cd7fe0334353bbf299 (patch)
treec3e423993ff5289dd0ba73a94881bd52d9cda1c2 /test/web/node_info_test.exs
parentf6fab01ba7a08fe0e5147f82d9e3dd294922dc93 (diff)
parentf8aa917eef9280631a5cd2c95cf1db8fab6e14e5 (diff)
downloadpleroma-aac48d0cc6893c231c88d5cd7fe0334353bbf299.tar.gz
pleroma-aac48d0cc6893c231c88d5cd7fe0334353bbf299.zip
Merge remote-tracking branch 'remotes/upstream/develop' into features/mastoapi/2.6.0-conversations
Diffstat (limited to 'test/web/node_info_test.exs')
-rw-r--r--test/web/node_info_test.exs23
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