summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2019-09-17 21:20:08 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2019-09-17 21:20:08 +0300
commit7dd51652f96db8479fb3848c3a993b74b7246d27 (patch)
treeeb8736f2a8312660aab215589dd9a0304d49f856 /test/integration
parentd75bc728e7e309174373e234079aa4825c81ab3e (diff)
parent7318095657175ff05a09af83b981110a58026cf9 (diff)
downloadpleroma-7dd51652f96db8479fb3848c3a993b74b7246d27.tar.gz
pleroma-7dd51652f96db8479fb3848c3a993b74b7246d27.zip
Merge branch 'develop' into issue/733
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/mastodon_websocket_test.exs18
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