diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2019-12-09 19:41:43 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2019-12-09 19:41:43 +0300 |
commit | 2b821036c4bd84cee51c9fcace5a4b3764c3bba1 (patch) | |
tree | 811d75ef4b0442f3f2102d873fab4e10c777e7f1 /test/web/twitter_api/util_controller_test.exs | |
parent | 5876a9cb79e53f932d63e457610852031669a222 (diff) | |
parent | 0d2c13a119302d0d217a7cb61c28a01c620b1b61 (diff) | |
download | pleroma-2b821036c4bd84cee51c9fcace5a4b3764c3bba1.tar.gz |
Merge branch 'develop' into issue/1383
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 |