diff options
| author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-09-17 22:53:26 +0300 |
|---|---|---|
| committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-09-17 22:53:26 +0300 |
| commit | 01c1078015c1ddbaa195125034489a14233df206 (patch) | |
| tree | 01c63b7d6a8040decf6e0cd1630b715ca2cb29c6 /test/integration/mastodon_websocket_test.exs | |
| parent | 76068873dbf9da191dd2487158ca88df198b811a (diff) | |
| parent | 79376abae347a5039931f57c581074b6da859827 (diff) | |
| download | pleroma-01c1078015c1ddbaa195125034489a14233df206.tar.gz pleroma-01c1078015c1ddbaa195125034489a14233df206.zip | |
[#1234] Merge remote-tracking branch 'remotes/upstream/develop' into 1234-mastodon-2-4-3-oauth-scopes
# Conflicts:
# lib/pleroma/web/activity_pub/activity_pub_controller.ex
Diffstat (limited to 'test/integration/mastodon_websocket_test.exs')
| -rw-r--r-- | test/integration/mastodon_websocket_test.exs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/integration/mastodon_websocket_test.exs b/test/integration/mastodon_websocket_test.exs index 63bf73412..d02a3cc4d 100644 --- a/test/integration/mastodon_websocket_test.exs +++ b/test/integration/mastodon_websocket_test.exs @@ -11,7 +11,6 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do alias Pleroma.Integration.WebsocketClient alias Pleroma.Web.CommonAPI alias Pleroma.Web.OAuth - alias Pleroma.Web.Streamer @path Pleroma.Web.Endpoint.url() |> URI.parse() @@ -19,14 +18,9 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do |> Map.put(:path, "/api/v1/streaming") |> URI.to_string() - setup do - GenServer.start(Streamer, %{}, name: Streamer) - - on_exit(fn -> - if pid = Process.whereis(Streamer) do - Process.exit(pid, :kill) - end - end) + setup_all do + start_supervised(Pleroma.Web.Streamer.supervisor()) + :ok end def start_socket(qs \\ nil, headers \\ []) do @@ -43,6 +37,7 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do capture_log(fn -> assert {:error, {400, _}} = start_socket() assert {:error, {404, _}} = start_socket("?stream=ncjdk") + Process.sleep(30) end) end @@ -50,6 +45,7 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do capture_log(fn -> assert {:error, {403, _}} = start_socket("?stream=user&access_token=aaaaaaaaaaaa") assert {:error, {403, _}} = start_socket("?stream=user") + Process.sleep(30) end) end @@ -108,6 +104,7 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do assert capture_log(fn -> assert {:error, {403, "Forbidden"}} = start_socket("?stream=user") + Process.sleep(30) end) =~ ":badarg" end @@ -116,6 +113,7 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do assert capture_log(fn -> assert {:error, {403, "Forbidden"}} = start_socket("?stream=user:notification") + Process.sleep(30) end) =~ ":badarg" end @@ -125,6 +123,8 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do assert capture_log(fn -> assert {:error, {403, "Forbidden"}} = start_socket("?stream=user", [{"Sec-WebSocket-Protocol", "I am a friend"}]) + + Process.sleep(30) end) =~ ":badarg" end end |
