diff options
author | tusooa <tusooa@kazv.moe> | 2023-03-31 21:47:37 -0400 |
---|---|---|
committer | tusooa <tusooa@kazv.moe> | 2023-10-15 17:19:40 -0400 |
commit | 2b5636bf127b1987736c281d346a5771c8168c09 (patch) | |
tree | 18f4672a549af61e14043c740e869936d9485f77 /test | |
parent | 14b1b9c9b0cc3a799e8aa8ad1e54ec1b6b3243d8 (diff) | |
download | pleroma-2b5636bf127b1987736c281d346a5771c8168c09.tar.gz pleroma-2b5636bf127b1987736c281d346a5771c8168c09.zip |
Allow unified streaming endpoint
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/integration/mastodon_websocket_test.exs | 5 | ||||
-rw-r--r-- | test/pleroma/web/streamer_test.exs | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/test/pleroma/integration/mastodon_websocket_test.exs b/test/pleroma/integration/mastodon_websocket_test.exs index 9be0445c0..3b120c10e 100644 --- a/test/pleroma/integration/mastodon_websocket_test.exs +++ b/test/pleroma/integration/mastodon_websocket_test.exs @@ -33,7 +33,6 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do test "refuses invalid requests" do capture_log(fn -> - assert {:error, %WebSockex.RequestError{code: 404}} = start_socket() assert {:error, %WebSockex.RequestError{code: 404}} = start_socket("?stream=ncjdk") Process.sleep(30) end) @@ -49,6 +48,10 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do end) end + test "allows unified stream" do + assert {:ok, _} = start_socket() + end + test "allows public streams without authentication" do assert {:ok, _} = start_socket("?stream=public") assert {:ok, _} = start_socket("?stream=public:local") diff --git a/test/pleroma/web/streamer_test.exs b/test/pleroma/web/streamer_test.exs index 7ab0e379b..da97b87d8 100644 --- a/test/pleroma/web/streamer_test.exs +++ b/test/pleroma/web/streamer_test.exs @@ -22,6 +22,10 @@ defmodule Pleroma.Web.StreamerTest do setup do: clear_config([:instance, :skip_thread_containment]) describe "get_topic/_ (unauthenticated)" do + test "allows no stream" do + assert {:ok, nil} = Streamer.get_topic(nil, nil, nil) + end + test "allows public" do assert {:ok, "public"} = Streamer.get_topic("public", nil, nil) assert {:ok, "public:local"} = Streamer.get_topic("public:local", nil, nil) |