summaryrefslogtreecommitdiff
path: root/test/notification_test.exs
diff options
context:
space:
mode:
authorRoman Chvanikov <chvanikoff@pm.me>2019-07-24 16:37:52 +0300
committerRoman Chvanikov <chvanikoff@pm.me>2019-07-24 16:37:52 +0300
commitd2da3d30f3349946500423bab53e0c1221ab7b9b (patch)
tree338d2e3b0412a9be89a462173e367495c5e9ad40 /test/notification_test.exs
parentafc7708dbe00a70be616f00f01b22b0d01b9b61b (diff)
parent53fad36b57b61b28db595e445cd01fd6044dab6b (diff)
downloadpleroma-d2da3d30f3349946500423bab53e0c1221ab7b9b.tar.gz
pleroma-d2da3d30f3349946500423bab53e0c1221ab7b9b.zip
Merge branch 'develop' into feature/digest-email
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 b4eb7fd0f..dd7bbacc4 100644
--- a/test/notification_test.exs
+++ b/test/notification_test.exs
@@ -44,6 +44,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