diff options
author | lain <lain@soykaf.club> | 2019-12-09 14:30:35 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-12-09 14:30:35 +0000 |
commit | e4ea0e20b32152a7f7497c2ec8ebbe5c71b3db47 (patch) | |
tree | a4e7c4469be886a588f54112910ea647a6e61b17 /test/web/twitter_api/util_controller_test.exs | |
parent | 8d2ca85cea7285330c724096b668b4b56b77caf8 (diff) | |
parent | 4692919ea68d30fbd1147ad9415a4573e31023be (diff) | |
download | pleroma-e4ea0e20b32152a7f7497c2ec8ebbe5c71b3db47.tar.gz pleroma-e4ea0e20b32152a7f7497c2ec8ebbe5c71b3db47.zip |
Merge branch 'issue/1342' into 'develop'
[#1342] Added privacy option to push notifications
See merge request pleroma/pleroma!1920
Diffstat (limited to 'test/web/twitter_api/util_controller_test.exs')
-rw-r--r-- | test/web/twitter_api/util_controller_test.exs | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs index 986ee01f3..734cd2211 100644 --- a/test/web/twitter_api/util_controller_test.exs +++ b/test/web/twitter_api/util_controller_test.exs @@ -159,11 +159,31 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do user = Repo.get(User, user.id) - assert %{ - "followers" => false, - "follows" => true, - "non_follows" => true, - "non_followers" => true + assert %Pleroma.User.NotificationSetting{ + followers: false, + follows: true, + non_follows: true, + non_followers: true, + privacy_option: false + } == user.notification_settings + end + + test "it update notificatin privacy option", %{conn: conn} do + user = insert(:user) + + conn + |> assign(:user, user) + |> put("/api/pleroma/notification_settings", %{"privacy_option" => "1"}) + |> json_response(:ok) + + user = refresh_record(user) + + assert %Pleroma.User.NotificationSetting{ + followers: true, + follows: true, + non_follows: true, + non_followers: true, + privacy_option: true } == user.notification_settings end end |