summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2019-07-23 13:14:26 -0500
committerMark Felder <feld@FreeBSD.org>2019-07-23 13:14:26 -0500
commitfd287387a042b86a62d80c41b1dd282316b6609b (patch)
tree58d0df849161ad7bdde39f16249ec85594da77e3 /test
parenta042a7ac6d65dca3e19e6c4ddd65d2010e94aeba (diff)
downloadpleroma-fd287387a042b86a62d80c41b1dd282316b6609b.tar.gz
pleroma-fd287387a042b86a62d80c41b1dd282316b6609b.zip
Do not notify subscribers for messages from users which are replies to others
Diffstat (limited to 'test')
-rw-r--r--test/notification_test.exs18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/notification_test.exs b/test/notification_test.exs
index dda570b49..06f0b6557 100644
--- a/test/notification_test.exs
+++ b/test/notification_test.exs
@@ -42,6 +42,24 @@ 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
+ })
+
+ refute Notification.create_notification(reply_activity, subscriber)
+ end
end
describe "create_notification" do