aboutsummaryrefslogtreecommitdiff
path: root/test/notification_test.exs
diff options
context:
space:
mode:
authorhref <href+git-pleroma@random.sh>2020-05-07 09:13:32 +0000
committerlain <lain@soykaf.club>2020-05-07 09:13:32 +0000
commit9491ba3e49450e80cd1c21358c01e4e06e3d881d (patch)
treea5af903d41983aca0f4522be35b907854a581757 /test/notification_test.exs
parent68a126317d7cdd670c8e244319da08ff85639d33 (diff)
downloadpleroma-9491ba3e49450e80cd1c21358c01e4e06e3d881d.tar.gz
Streamer rework
Diffstat (limited to 'test/notification_test.exs')
-rw-r--r--test/notification_test.exs18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/notification_test.exs b/test/notification_test.exs
index 601a6c0ca..5c85f3368 100644
--- a/test/notification_test.exs
+++ b/test/notification_test.exs
@@ -162,14 +162,18 @@ defmodule Pleroma.NotificationTest do
@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)
- task_user_notification = Task.async(fn -> assert_receive {:text, _}, 4_000 end)
- Streamer.add_socket("user", %{transport_pid: task.pid, assigns: %{user: user}})
- Streamer.add_socket(
- "user:notification",
- %{transport_pid: task_user_notification.pid, assigns: %{user: user}}
- )
+ task =
+ Task.async(fn ->
+ Streamer.add_socket("user", user)
+ assert_receive {:render_with_user, _, _, _}, 4_000
+ end)
+
+ task_user_notification =
+ Task.async(fn ->
+ Streamer.add_socket("user:notification", user)
+ assert_receive {:render_with_user, _, _, _}, 4_000
+ end)
activity = insert(:note_activity)