Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2022-07-08 21:28:23 +02:00
parent 9423052e92
commit 3ed39e3109
1 changed files with 15 additions and 0 deletions

View File

@ -128,6 +128,21 @@ test "does not create a notification for subscribed users if status is a reply"
subscriber_notifications = Notification.for_user(subscriber) subscriber_notifications = Notification.for_user(subscriber)
assert Enum.empty?(subscriber_notifications) assert Enum.empty?(subscriber_notifications)
end end
test "does not create subscriber notification if mentioned" do
user = insert(:user)
subscriber = insert(:user)
User.subscribe(subscriber, user)
{:ok, status} = CommonAPI.post(user, %{status: "mentioning @#{subscriber.nickname}"})
{:ok, [notification] = notifications} = Notification.create_notifications(status)
assert length(notifications) == 1
assert notification.user_id == subscriber.id
assert notification.type == "mention"
end
end end
test "create_poll_notifications/1" do test "create_poll_notifications/1" do