diff options
| author | rinpatch <rinpatch@sdf.org> | 2019-10-21 16:44:17 +0000 |
|---|---|---|
| committer | rinpatch <rinpatch@sdf.org> | 2019-10-21 16:44:17 +0000 |
| commit | 6712b6e4de304eac09955689bcefbbe21d7fc1a5 (patch) | |
| tree | 19e27df441249bb4bdcc3ab4c32af70058ef988a /test | |
| parent | ce750dbab5de905af1e0ba6ba6a5a08b41600ac1 (diff) | |
| parent | 2dbee29cf5a1a17438e8bc3d2586717da64e20ff (diff) | |
| download | pleroma-6712b6e4de304eac09955689bcefbbe21d7fc1a5.tar.gz pleroma-6712b6e4de304eac09955689bcefbbe21d7fc1a5.zip | |
Merge branch 'fix/notifs-exclude-blocked-from-with-muted' into 'develop'
Do not include notifications from blocked users when with_muted is set
See merge request pleroma/pleroma!1869
Diffstat (limited to 'test')
| -rw-r--r-- | test/notification_test.exs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/notification_test.exs b/test/notification_test.exs index 54c0f9877..96316f8dd 100644 --- a/test/notification_test.exs +++ b/test/notification_test.exs @@ -683,7 +683,7 @@ defmodule Pleroma.NotificationTest do assert Notification.for_user(user) == [] end - test "it returns notifications for muted user with notifications and with_muted parameter" do + test "it returns notifications from a muted user when with_muted is set" do user = insert(:user) muted = insert(:user) {:ok, user} = User.mute(user, muted) @@ -693,27 +693,27 @@ defmodule Pleroma.NotificationTest do assert length(Notification.for_user(user, %{with_muted: true})) == 1 end - test "it returns notifications for blocked user and with_muted parameter" do + test "it doesn't return notifications from a blocked user when with_muted is set" do user = insert(:user) blocked = insert(:user) {:ok, user} = User.block(user, blocked) {:ok, _activity} = CommonAPI.post(blocked, %{"status" => "hey @#{user.nickname}"}) - assert length(Notification.for_user(user, %{with_muted: true})) == 1 + assert length(Notification.for_user(user, %{with_muted: true})) == 0 end - test "it returns notificatitons for blocked domain and with_muted parameter" do + test "it doesn't return notifications from a domain-blocked user when with_muted is set" do user = insert(:user) blocked = insert(:user, ap_id: "http://some-domain.com") {:ok, user} = User.block_domain(user, "some-domain.com") {:ok, _activity} = CommonAPI.post(blocked, %{"status" => "hey @#{user.nickname}"}) - assert length(Notification.for_user(user, %{with_muted: true})) == 1 + assert length(Notification.for_user(user, %{with_muted: true})) == 0 end - test "it returns notifications for muted thread with_muted parameter" do + test "it returns notifications from muted threads when with_muted is set" do user = insert(:user) another_user = insert(:user) |
