aboutsummaryrefslogtreecommitdiff
path: root/test/web/twitter_api
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-03-21 16:16:26 +0100
committerlain <lain@soykaf.club>2019-03-21 16:20:58 +0100
commitbf27190f7f0942a05de518f2085a299eb011614c (patch)
treefe85189f0649bb1457671fbbb7d0e110792b04ba /test/web/twitter_api
parent8468f3f6d48693d2a27a257e5555aa71decff3df (diff)
downloadpleroma-bf27190f7f0942a05de518f2085a299eb011614c.tar.gz
UtilController: Return state of safe dm mentions.
Diffstat (limited to 'test/web/twitter_api')
-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")