summaryrefslogtreecommitdiff
path: root/test/web/twitter_api/util_controller_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-03-25 13:37:32 +0100
committerlain <lain@soykaf.club>2019-03-25 13:37:32 +0100
commit037fefe21871ee0a1926286c87c334ea1d339394 (patch)
tree2775b91de5652ddd5baa3e32861ac9cac4bc40be /test/web/twitter_api/util_controller_test.exs
parentf6fab01ba7a08fe0e5147f82d9e3dd294922dc93 (diff)
parentb028b0f97d4b6310b1402b3b876aa8f8b286bc4d (diff)
downloadpleroma-037fefe21871ee0a1926286c87c334ea1d339394.tar.gz
pleroma-037fefe21871ee0a1926286c87c334ea1d339394.zip
Merge remote-tracking branch 'origin/develop' into features/mastoapi/2.6.0-conversations
Diffstat (limited to 'test/web/twitter_api/util_controller_test.exs')
-rw-r--r--test/web/twitter_api/util_controller_test.exs23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs
index 6e8a25056..832fdc096 100644
--- a/test/web/twitter_api/util_controller_test.exs
+++ b/test/web/twitter_api/util_controller_test.exs
@@ -75,6 +75,29 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
end
describe "GET /api/statusnet/config.json" do
+ test "returns the state of safe_dm_mentions flag", %{conn: conn} do
+ option = Pleroma.Config.get([:instance, :safe_dm_mentions])
+ Pleroma.Config.put([:instance, :safe_dm_mentions], true)
+
+ response =
+ conn
+ |> get("/api/statusnet/config.json")
+ |> json_response(:ok)
+
+ assert response["site"]["safeDMMentionsEnabled"] == "1"
+
+ Pleroma.Config.put([:instance, :safe_dm_mentions], false)
+
+ response =
+ conn
+ |> get("/api/statusnet/config.json")
+ |> json_response(:ok)
+
+ assert response["site"]["safeDMMentionsEnabled"] == "0"
+
+ Pleroma.Config.put([:instance, :safe_dm_mentions], option)
+ end
+
test "it returns the managed config", %{conn: conn} do
Pleroma.Config.put([:instance, :managed_config], false)
Pleroma.Config.put([:fe], theme: "rei-ayanami-towel")