aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-11-02 22:08:22 +0100
committerRoger Braun <roger@rogerbraun.net>2017-11-02 22:08:22 +0100
commit632da6c9273b55984bdd67b8a10672733df7fae5 (patch)
tree60a1516f09af794f2295bbb0f539a3aeaad38207 /test
parent6a5f0871745316b50742ea9ebf3ff7c69881e105 (diff)
downloadpleroma-632da6c9273b55984bdd67b8a10672733df7fae5.tar.gz
Don't create notifications if the user is blocked.
Diffstat (limited to 'test')
-rw-r--r--test/notification_test.exs11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/notification_test.exs b/test/notification_test.exs
index f50b3cb24..77fdb532f 100644
--- a/test/notification_test.exs
+++ b/test/notification_test.exs
@@ -20,4 +20,15 @@ defmodule Pleroma.NotificationTest do
assert other_notification.activity_id == activity.id
end
end
+
+ describe "create_notification" do
+ test "it doesn't create a notification for user if the user blocks the activity author" do
+ activity = insert(:note_activity)
+ author = User.get_by_ap_id(activity.data["actor"])
+ user = insert(:user)
+ {:ok, user} = User.block(user, author)
+
+ assert nil == Notification.create_notification(activity, user)
+ end
+ end
end