diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-10-29 15:35:42 +0400 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-10-29 15:35:42 +0400 |
commit | fa902867c07212a7d2936a953037c22a40cda51e (patch) | |
tree | e324c9afc7651ee6f79f6718d7b46b09b1ed20be /test/support | |
parent | 76c4e80e5a1b59efeeaf7797d9c08081b7a66c5f (diff) | |
parent | 0e0a6aef70fc0cac1f9176e4f50a7fe4930242fa (diff) | |
download | pleroma-fa902867c07212a7d2936a953037c22a40cda51e.tar.gz pleroma-fa902867c07212a7d2936a953037c22a40cda51e.zip |
Merge remote-tracking branch 'origin/develop' into mutes-blocks-pagination
Diffstat (limited to 'test/support')
-rw-r--r-- | test/support/channel_case.ex | 2 | ||||
-rw-r--r-- | test/support/conn_case.ex | 25 |
2 files changed, 3 insertions, 24 deletions
diff --git a/test/support/channel_case.ex b/test/support/channel_case.ex index d63a0f06b..114184a9f 100644 --- a/test/support/channel_case.ex +++ b/test/support/channel_case.ex @@ -22,7 +22,7 @@ defmodule Pleroma.Web.ChannelCase do using do quote do # Import conveniences for testing with channels - use Phoenix.ChannelTest + import Phoenix.ChannelTest use Pleroma.Tests.Helpers # The default endpoint for testing diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex index 7ef681258..47cb65a80 100644 --- a/test/support/conn_case.ex +++ b/test/support/conn_case.ex @@ -22,7 +22,8 @@ defmodule Pleroma.Web.ConnCase do using do quote do # Import conveniences for testing with connections - use Phoenix.ConnTest + import Plug.Conn + import Phoenix.ConnTest use Pleroma.Tests.Helpers import Pleroma.Web.Router.Helpers @@ -111,28 +112,6 @@ defmodule Pleroma.Web.ConnCase do defp json_response_and_validate_schema(conn, _status) do flunk("Response schema not found for #{conn.method} #{conn.request_path} #{conn.status}") end - - defp ensure_federating_or_authenticated(conn, url, user) do - initial_setting = Config.get([:instance, :federating]) - on_exit(fn -> Config.put([:instance, :federating], initial_setting) end) - - Config.put([:instance, :federating], false) - - conn - |> get(url) - |> response(403) - - conn - |> assign(:user, user) - |> get(url) - |> response(200) - - Config.put([:instance, :federating], true) - - conn - |> get(url) - |> response(200) - end end end |