X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Fnotification_test.exs;h=1dbad34c167292d8bedf012e787cd952ea95e49a;hb=705ea1b975779180c15d7b32d22f7fb9a11b2ed9;hp=3be9db09b38074e3bd2868c6eea32a559dbe8e9c;hpb=c623b4324deaf236334a0f77a81435b5bffadf3c;p=akkoma
diff --git a/test/notification_test.exs b/test/notification_test.exs
index 3be9db09b..1dbad34c1 100644
--- a/test/notification_test.exs
+++ b/test/notification_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2018 Pleroma Authors
+# Copyright © 2017-2019 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.NotificationTest do
@@ -33,16 +33,16 @@ defmodule Pleroma.NotificationTest do
assert other_notification.activity_id == activity.id
end
- test "it creates a notification for subscribed users" do
+ test "it does not create a notification for subscribed users" do
user = insert(:user)
subscriber = insert(:user)
User.subscribe(subscriber, user)
{:ok, status} = CommonAPI.post(user, %{"status" => "Akariiiin"})
- {:ok, [notification]} = Notification.create_notifications(status)
+ {:ok, notifications} = Notification.create_notifications(status)
- assert notification.user_id == subscriber.id
+ assert notifications == []
end
test "does not create a notification for subscribed users if status is a reply" do
@@ -69,16 +69,7 @@ defmodule Pleroma.NotificationTest do
end
describe "create_notification" do
- setup do
- GenServer.start(Streamer, %{}, name: Streamer)
-
- on_exit(fn ->
- if pid = Process.whereis(Streamer) do
- Process.exit(pid, :kill)
- end
- end)
- end
-
+ @tag needs_streamer: true
test "it creates a notification for user and send to the 'user' and the 'user:notification' stream" do
user = insert(:user)
task = Task.async(fn -> assert_receive {:text, _}, 4_000 end)
@@ -191,14 +182,16 @@ defmodule Pleroma.NotificationTest do
refute Notification.create_notification(activity_dupe, followed_user)
end
- test "it doesn't create duplicate notifications for follow+subscribed users" do
+ test "it doesn't create notifications for follow+subscribed users" do
user = insert(:user)
subscriber = insert(:user)
{:ok, _, _, _} = CommonAPI.follow(subscriber, user)
User.subscribe(subscriber, user)
{:ok, status} = CommonAPI.post(user, %{"status" => "Akariiiin"})
- {:ok, [_notif]} = Notification.create_notifications(status)
+ {:ok, notifications} = Notification.create_notifications(status)
+
+ assert notifications == []
end
test "it doesn't create subscription notifications if the recipient cannot see the status" do