diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2019-10-28 12:47:23 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2019-11-28 22:08:30 +0300 |
commit | a52da55eb9c6bbf8a08bf1d90d59a48dc25f5907 (patch) | |
tree | 766d151dfa013931b636b723746061bbeb4f1429 /test/web/twitter_api/util_controller_test.exs | |
parent | ca1acfa314a57f78c2f5f8e60a4bd1380350e483 (diff) | |
download | pleroma-a52da55eb9c6bbf8a08bf1d90d59a48dc25f5907.tar.gz pleroma-a52da55eb9c6bbf8a08bf1d90d59a48dc25f5907.zip |
added User.NotificationSetting struct
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 f0211f59c..f1557c193 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: "name_and_message" + } == 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" => "name_only"}) + |> json_response(:ok) + + user = refresh_record(user) + + assert %Pleroma.User.NotificationSetting{ + followers: true, + follows: true, + non_follows: true, + non_followers: true, + privacy_option: "name_only" } == user.notification_settings end end |