API compatibility with fedibird, frontend config (#163)
[akkoma] / test / pleroma / integration / mastodon_websocket_test.exs
index 0f2e6cc2b0a1169e84cdb62fc55523133dc0013d..356bfa48df480934ea6d60ac34f2e79fb3a2a5dc 100644 (file)
@@ -1,8 +1,9 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Integration.MastodonWebsocketTest do
+  # Needs a streamer, needs to stay synchronous
   use Pleroma.DataCase
 
   import ExUnit.CaptureLog
@@ -30,9 +31,9 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do
     WebsocketClient.start_link(self(), path, headers)
   end
 
-  test "refuses invalid requests" do
+  test "allows multi-streams" do
     capture_log(fn ->
-      assert {:error, {404, _}} = start_socket()
+      assert {:ok, _} = start_socket()
       assert {:error, {404, _}} = start_socket("?stream=ncjdk")
       Process.sleep(30)
     end)
@@ -49,6 +50,7 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do
   test "allows public streams without authentication" do
     assert {:ok, _} = start_socket("?stream=public")
     assert {:ok, _} = start_socket("?stream=public:local")
+    assert {:ok, _} = start_socket("?stream=public:remote&instance=lain.com")
     assert {:ok, _} = start_socket("?stream=hashtag&tag=lain")
   end