diff options
author | lain <lain@soykaf.club> | 2019-03-21 16:16:26 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-03-21 16:20:58 +0100 |
commit | bf27190f7f0942a05de518f2085a299eb011614c (patch) | |
tree | fe85189f0649bb1457671fbbb7d0e110792b04ba /test | |
parent | 8468f3f6d48693d2a27a257e5555aa71decff3df (diff) | |
download | pleroma-bf27190f7f0942a05de518f2085a299eb011614c.tar.gz |
UtilController: Return state of safe dm mentions.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/twitter_api/util_controller_test.exs | 23 |
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") |