diff options
author | kaniini <ariadne@dereferenced.org> | 2019-07-23 19:13:55 +0000 |
---|---|---|
committer | kaniini <ariadne@dereferenced.org> | 2019-07-23 19:13:55 +0000 |
commit | 03d89e182e0323f775232a4ddab66615f39dc765 (patch) | |
tree | 48a28b791485eef83f847c83f15f870150eb8308 /test | |
parent | 638f772356afdb92a722ae54059604dbbab94d58 (diff) | |
parent | ec7b085b76996bee7eaa60c21b9d8a0cba382a65 (diff) | |
download | pleroma-03d89e182e0323f775232a4ddab66615f39dc765.tar.gz pleroma-03d89e182e0323f775232a4ddab66615f39dc765.zip |
Merge branch 'fix/subscriber-notifications' into 'develop'
Do not notify subscribers for messages from users which are replies to others
See merge request pleroma/pleroma!1477
Diffstat (limited to 'test')
-rw-r--r-- | test/notification_test.exs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/notification_test.exs b/test/notification_test.exs index dda570b49..28f8df49d 100644 --- a/test/notification_test.exs +++ b/test/notification_test.exs @@ -42,6 +42,28 @@ defmodule Pleroma.NotificationTest do assert notification.user_id == subscriber.id end + + test "does not create a notification for subscribed users if status is a reply" do + user = insert(:user) + other_user = insert(:user) + subscriber = insert(:user) + + User.subscribe(subscriber, other_user) + + {:ok, activity} = CommonAPI.post(user, %{"status" => "test post"}) + + {:ok, _reply_activity} = + CommonAPI.post(other_user, %{ + "status" => "test reply", + "in_reply_to_status_id" => activity.id + }) + + user_notifications = Notification.for_user(user) + assert length(user_notifications) == 1 + + subscriber_notifications = Notification.for_user(subscriber) + assert Enum.empty?(subscriber_notifications) + end end describe "create_notification" do |