diff options
author | href <href@random.sh> | 2020-05-12 18:04:47 +0200 |
---|---|---|
committer | href <href@random.sh> | 2020-05-12 18:04:47 +0200 |
commit | e6d8cacf2de4ba48b881a390b0ba4582981d17a5 (patch) | |
tree | 1535a972c930e5cad4b2ca8d18a3101a1845394e /test/integration/mastodon_websocket_test.exs | |
parent | fdc9ac88976c229288052cd66cda6b37e3887200 (diff) | |
download | pleroma-e6d8cacf2de4ba48b881a390b0ba4582981d17a5.tar.gz pleroma-e6d8cacf2de4ba48b881a390b0ba4582981d17a5.zip |
Expand and authorize streams in Streamer directly
Diffstat (limited to 'test/integration/mastodon_websocket_test.exs')
-rw-r--r-- | test/integration/mastodon_websocket_test.exs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/integration/mastodon_websocket_test.exs b/test/integration/mastodon_websocket_test.exs index 109c7b4cb..63f351a80 100644 --- a/test/integration/mastodon_websocket_test.exs +++ b/test/integration/mastodon_websocket_test.exs @@ -32,7 +32,7 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do test "refuses invalid requests" do capture_log(fn -> - assert {:error, {400, _}} = start_socket() + assert {:error, {404, _}} = start_socket() assert {:error, {404, _}} = start_socket("?stream=ncjdk") Process.sleep(30) end) @@ -40,8 +40,8 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do test "requires authentication and a valid token for protected streams" do capture_log(fn -> - assert {:error, {403, _}} = start_socket("?stream=user&access_token=aaaaaaaaaaaa") - assert {:error, {403, _}} = start_socket("?stream=user") + assert {:error, {401, _}} = start_socket("?stream=user&access_token=aaaaaaaaaaaa") + assert {:error, {401, _}} = start_socket("?stream=user") Process.sleep(30) end) end @@ -100,7 +100,7 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do assert {:ok, _} = start_socket("?stream=user&access_token=#{token.token}") assert capture_log(fn -> - assert {:error, {403, "Forbidden"}} = start_socket("?stream=user") + assert {:error, {401, _}} = start_socket("?stream=user") Process.sleep(30) end) =~ ":badarg" end @@ -109,7 +109,7 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do assert {:ok, _} = start_socket("?stream=user:notification&access_token=#{token.token}") assert capture_log(fn -> - assert {:error, {403, "Forbidden"}} = start_socket("?stream=user:notification") + assert {:error, {401, _}} = start_socket("?stream=user:notification") Process.sleep(30) end) =~ ":badarg" end @@ -118,7 +118,7 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do assert {:ok, _} = start_socket("?stream=user", [{"Sec-WebSocket-Protocol", token.token}]) assert capture_log(fn -> - assert {:error, {403, "Forbidden"}} = + assert {:error, {401, "Forbidden"}} = start_socket("?stream=user", [{"Sec-WebSocket-Protocol", "I am a friend"}]) Process.sleep(30) |