From 9eea80002673eb1359a2d4369c65a89c42c2f707 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 28 May 2020 10:16:09 -0500 Subject: Refactor notification settings --- test/web/twitter_api/util_controller_test.exs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'test/web/twitter_api/util_controller_test.exs') diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs index ad919d341..1133107f4 100644 --- a/test/web/twitter_api/util_controller_test.exs +++ b/test/web/twitter_api/util_controller_test.exs @@ -191,7 +191,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do test "it updates notification settings", %{user: user, conn: conn} do conn |> put("/api/pleroma/notification_settings", %{ - "followers" => false, + "from_followers" => false, "bar" => 1 }) |> json_response(:ok) @@ -199,10 +199,9 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do user = refresh_record(user) assert %Pleroma.User.NotificationSetting{ - followers: false, - follows: true, - non_follows: true, - non_followers: true, + from_followers: false, + from_following: true, + from_strangers: true, privacy_option: false } == user.notification_settings end @@ -215,10 +214,9 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do user = refresh_record(user) assert %Pleroma.User.NotificationSetting{ - followers: true, - follows: true, - non_follows: true, - non_followers: true, + from_followers: true, + from_following: true, + from_strangers: true, privacy_option: true } == user.notification_settings end -- cgit v1.2.3 From fd5e797379155e5a85deb88dc79f8fbca483948e Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Fri, 26 Jun 2020 11:24:28 -0500 Subject: Simplify notification filtering settings further --- test/web/twitter_api/util_controller_test.exs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'test/web/twitter_api/util_controller_test.exs') diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs index 1133107f4..da3f6fa61 100644 --- a/test/web/twitter_api/util_controller_test.exs +++ b/test/web/twitter_api/util_controller_test.exs @@ -191,7 +191,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do test "it updates notification settings", %{user: user, conn: conn} do conn |> put("/api/pleroma/notification_settings", %{ - "from_followers" => false, + "block_from_strangers" => true, "bar" => 1 }) |> json_response(:ok) @@ -199,9 +199,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do user = refresh_record(user) assert %Pleroma.User.NotificationSetting{ - from_followers: false, - from_following: true, - from_strangers: true, + block_from_strangers: true, privacy_option: false } == user.notification_settings end @@ -214,9 +212,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do user = refresh_record(user) assert %Pleroma.User.NotificationSetting{ - from_followers: true, - from_following: true, - from_strangers: true, + block_from_strangers: false, privacy_option: true } == user.notification_settings end -- cgit v1.2.3 From 69848d5c97c9e5d4c14fb5613eb174cb81d5026d Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Fri, 26 Jun 2020 12:45:46 -0500 Subject: Rename notification "privacy_option" setting --- test/web/twitter_api/util_controller_test.exs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/web/twitter_api/util_controller_test.exs') diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs index da3f6fa61..b8ddadb50 100644 --- a/test/web/twitter_api/util_controller_test.exs +++ b/test/web/twitter_api/util_controller_test.exs @@ -200,20 +200,20 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do assert %Pleroma.User.NotificationSetting{ block_from_strangers: true, - privacy_option: false + hide_notification_contents: false } == user.notification_settings end - test "it updates notification privacy option", %{user: user, conn: conn} do + test "it updates notification settings to enable hiding contents", %{user: user, conn: conn} do conn - |> put("/api/pleroma/notification_settings", %{"privacy_option" => "1"}) + |> put("/api/pleroma/notification_settings", %{"hide_notification_contents" => "1"}) |> json_response(:ok) user = refresh_record(user) assert %Pleroma.User.NotificationSetting{ block_from_strangers: false, - privacy_option: true + hide_notification_contents: true } == user.notification_settings end end -- cgit v1.2.3