X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fnotification_test.exs;h=69f426e4d9b2d493901c0ba369952a934aad5cfd;hb=b078e0567dbecc768f88d991a2565141eb9e8c50;hp=a256f08d1390241fd63ba505a57a20f91c0d0cd5;hpb=bd261309cc27ebf5d2f78ea3c1474fe71ae8046d;p=akkoma diff --git a/test/notification_test.exs b/test/notification_test.exs index a256f08d1..69f426e4d 100644 --- a/test/notification_test.exs +++ b/test/notification_test.exs @@ -165,14 +165,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) @@ -737,7 +741,7 @@ defmodule Pleroma.NotificationTest do assert length(Notification.for_user(user)) == 1 - {:ok, _, _, _} = CommonAPI.unfavorite(activity.id, other_user) + {:ok, _} = CommonAPI.unfavorite(activity.id, other_user) assert Enum.empty?(Notification.for_user(user)) end @@ -771,7 +775,7 @@ defmodule Pleroma.NotificationTest do assert length(Notification.for_user(user)) == 1 - {:ok, _, _} = CommonAPI.unrepeat(activity.id, other_user) + {:ok, _} = CommonAPI.unrepeat(activity.id, other_user) assert Enum.empty?(Notification.for_user(user)) end