diff options
author | eugenijm <eugenijm@protonmail.com> | 2019-03-28 14:52:09 +0300 |
---|---|---|
committer | eugenijm <eugenijm@protonmail.com> | 2019-03-28 18:55:16 +0300 |
commit | cd90695a349f33b84f287794bae6070e9eec446a (patch) | |
tree | 92fc170ff80b7c066f7f795b1a3e91f81279edf2 /test/web/twitter_api | |
parent | 55d086b52077a220aef60c8d9071aea990431d74 (diff) | |
download | pleroma-cd90695a349f33b84f287794bae6070e9eec446a.tar.gz |
Add PUT /api/pleroma/notification_settings endpoint
Diffstat (limited to 'test/web/twitter_api')
-rw-r--r-- | test/web/twitter_api/util_controller_test.exs | 21 |
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 832fdc096..426508353 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 @@ -74,6 +75,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]) |