summaryrefslogtreecommitdiff
path: root/test/web/twitter_api
diff options
context:
space:
mode:
Diffstat (limited to 'test/web/twitter_api')
-rw-r--r--test/web/twitter_api/util_controller_test.exs30
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