logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 3ed39e310939d90ddbad7bd7ffa1ebd8aca6e74c
parent 9423052e9217aa1358950d37c5c96b11d554b37a
Author: marcin mikołajczak <git@mkljczk.pl>
Date:   Fri,  8 Jul 2022 21:28:23 +0200

Add test

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>

Diffstat:

Mtest/pleroma/notification_test.exs15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git a/test/pleroma/notification_test.exs b/test/pleroma/notification_test.exs @@ -128,6 +128,21 @@ defmodule Pleroma.NotificationTest do subscriber_notifications = Notification.for_user(subscriber) assert Enum.empty?(subscriber_notifications) 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 test "create_poll_notifications/1" do