diff options
author | feld <feld@feld.me> | 2020-07-15 15:22:39 +0000 |
---|---|---|
committer | feld <feld@feld.me> | 2020-07-15 15:22:39 +0000 |
commit | 00f9b53f07346d052adab105bde3428c98fc4660 (patch) | |
tree | 67e501144cffd4c3e70f8dc094793c6b2d2fb7b5 /test/notification_test.exs | |
parent | 0fe36b311c010f9a4bd3c1600ce874c5403a7368 (diff) | |
parent | 34d1d3e93e8642f2b784b5b957551af068c0f7ba (diff) | |
download | pleroma-00f9b53f07346d052adab105bde3428c98fc4660.tar.gz pleroma-00f9b53f07346d052adab105bde3428c98fc4660.zip |
Merge branch 'refactor/notification_settings' into 'develop'
Refactor notification settings
See merge request pleroma/pleroma!2602
Diffstat (limited to 'test/notification_test.exs')
-rw-r--r-- | test/notification_test.exs | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/test/notification_test.exs b/test/notification_test.exs index 13e82ab2a..8243cfd34 100644 --- a/test/notification_test.exs +++ b/test/notification_test.exs @@ -246,49 +246,18 @@ defmodule Pleroma.NotificationTest do assert Notification.create_notification(activity, muter) end - test "it disables notifications from followers" do - follower = insert(:user) - - followed = - insert(:user, notification_settings: %Pleroma.User.NotificationSetting{followers: false}) - - User.follow(follower, followed) - {:ok, activity} = CommonAPI.post(follower, %{status: "hey @#{followed.nickname}"}) - refute Notification.create_notification(activity, followed) - end - - test "it disables notifications from non-followers" do + test "it disables notifications from strangers" do follower = insert(:user) followed = insert(:user, - notification_settings: %Pleroma.User.NotificationSetting{non_followers: false} + notification_settings: %Pleroma.User.NotificationSetting{block_from_strangers: true} ) {:ok, activity} = CommonAPI.post(follower, %{status: "hey @#{followed.nickname}"}) refute Notification.create_notification(activity, followed) end - test "it disables notifications from people the user follows" do - follower = - insert(:user, notification_settings: %Pleroma.User.NotificationSetting{follows: false}) - - followed = insert(:user) - User.follow(follower, followed) - follower = Repo.get(User, follower.id) - {:ok, activity} = CommonAPI.post(followed, %{status: "hey @#{follower.nickname}"}) - refute Notification.create_notification(activity, follower) - end - - test "it disables notifications from people the user does not follow" do - follower = - insert(:user, notification_settings: %Pleroma.User.NotificationSetting{non_follows: false}) - - followed = insert(:user) - {:ok, activity} = CommonAPI.post(followed, %{status: "hey @#{follower.nickname}"}) - refute Notification.create_notification(activity, follower) - end - test "it doesn't create a notification for user if he is the activity author" do activity = insert(:note_activity) author = User.get_cached_by_ap_id(activity.data["actor"]) |