summaryrefslogtreecommitdiff
path: root/test/web/twitter_api/util_controller_test.exs
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2019-04-10 02:10:31 +0000
committerkaniini <nenolod@gmail.com>2019-04-10 02:10:31 +0000
commit97395e013e5dac84399769438f8b90cffa38afd5 (patch)
tree1429546e8d412f5c52b5be77115c87f1bbb831a5 /test/web/twitter_api/util_controller_test.exs
parent144648de92abea7330cf264b7608634a27bb6bdf (diff)
parentcd90695a349f33b84f287794bae6070e9eec446a (diff)
downloadpleroma-97395e013e5dac84399769438f8b90cffa38afd5.tar.gz
pleroma-97395e013e5dac84399769438f8b90cffa38afd5.zip
Merge branch 'notification-pleroma-settings' into 'develop'
Notification controls Closes #738 See merge request pleroma/pleroma!988
Diffstat (limited to 'test/web/twitter_api/util_controller_test.exs')
-rw-r--r--test/web/twitter_api/util_controller_test.exs21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs
index 410f20f87..01af8c1df 100644
--- a/test/web/twitter_api/util_controller_test.exs
+++ b/test/web/twitter_api/util_controller_test.exs
@@ -3,6 +3,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
alias Pleroma.Notification
alias Pleroma.Repo
+ alias Pleroma.User
alias Pleroma.Web.CommonAPI
import Pleroma.Factory
@@ -79,6 +80,26 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
end
end
+ describe "PUT /api/pleroma/notification_settings" do
+ test "it updates notification settings", %{conn: conn} do
+ user = insert(:user)
+
+ conn
+ |> assign(:user, user)
+ |> put("/api/pleroma/notification_settings", %{
+ "remote" => false,
+ "followers" => false,
+ "bar" => 1
+ })
+ |> json_response(:ok)
+
+ user = Repo.get(User, user.id)
+
+ assert %{"remote" => false, "local" => true, "followers" => false, "follows" => true} ==
+ user.info.notification_settings
+ end
+ 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])