summaryrefslogtreecommitdiff
path: root/test/notification_test.exs
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-07-25 18:43:30 +0300
committerrinpatch <rinpatch@sdf.org>2019-07-25 18:43:30 +0300
commit41e0304757c5a0d9778f7e685c9ddf481f0e15cb (patch)
treedc60d86d41153d9764cb32a9adae5fa24894c1fa /test/notification_test.exs
parent196cad46f35a63c18d58cd5d982bc4e1f9b0d7c3 (diff)
parentd1e891062e3c6c34ca7940a476917beea2822ca2 (diff)
downloadpleroma-41e0304757c5a0d9778f7e685c9ddf481f0e15cb.tar.gz
pleroma-41e0304757c5a0d9778f7e685c9ddf481f0e15cb.zip
Merge branch 'develop' into feature/hide-follows-remote
Diffstat (limited to 'test/notification_test.exs')
-rw-r--r--test/notification_test.exs22
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