diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2019-09-19 07:35:34 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2019-09-19 07:35:34 +0300 |
commit | d4ed3a35b8aa34cd968113970bbab445eb251703 (patch) | |
tree | dbbf93e12e33932d7774ab72fb54ff0ee08031d1 /test/notification_test.exs | |
parent | 2b40e57a72f3ee3209b204a5ae5e0221b1d66c7e (diff) | |
parent | f95a2b2cda236f7c0e5ced2a4698e2b10d99fa53 (diff) | |
download | pleroma-d4ed3a35b8aa34cd968113970bbab445eb251703.tar.gz pleroma-d4ed3a35b8aa34cd968113970bbab445eb251703.zip |
Merge branch 'develop' into test/activity_pub/transmogrifier.ex
Diffstat (limited to 'test/notification_test.exs')
-rw-r--r-- | test/notification_test.exs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/test/notification_test.exs b/test/notification_test.exs index 2a52dad8d..54c0f9877 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 <https://pleroma.social/> +# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/> # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.NotificationTest do @@ -8,6 +8,7 @@ defmodule Pleroma.NotificationTest do import Pleroma.Factory alias Pleroma.Notification + alias Pleroma.Tests.ObanHelpers alias Pleroma.User alias Pleroma.Web.ActivityPub.Transmogrifier alias Pleroma.Web.CommonAPI @@ -68,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) @@ -588,7 +580,8 @@ defmodule Pleroma.NotificationTest do refute Enum.empty?(Notification.for_user(other_user)) - User.delete(user) + {:ok, job} = User.delete(user) + ObanHelpers.perform(job) assert Enum.empty?(Notification.for_user(other_user)) end @@ -633,6 +626,7 @@ defmodule Pleroma.NotificationTest do } {:ok, _delete_activity} = Transmogrifier.handle_incoming(delete_user_message) + ObanHelpers.perform_all() assert Enum.empty?(Notification.for_user(local_user)) end |