summaryrefslogtreecommitdiff
path: root/test/support/conn_case.ex
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2021-01-21 09:03:26 +0000
committerlain <lain@soykaf.club>2021-01-21 09:03:26 +0000
commitba40af054cc90417c5b2b347e325b53c7346e29c (patch)
treeead7b2e7bfbbfb297a466eb9c9cd84aedda197e4 /test/support/conn_case.ex
parentb5899fda1a38c2ce2d26ebd5082d864c84105622 (diff)
parent318d6dde1c6cb0c3d6c9e31b976d71de8c721d8d (diff)
downloadpleroma-ba40af054cc90417c5b2b347e325b53c7346e29c.tar.gz
pleroma-ba40af054cc90417c5b2b347e325b53c7346e29c.zip
Merge branch 'test-cases-mox-setup' into 'develop'
Mox mode setup tweak; refactoring See merge request pleroma/pleroma!3263
Diffstat (limited to 'test/support/conn_case.ex')
-rw-r--r--test/support/conn_case.ex26
1 files changed, 5 insertions, 21 deletions
diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex
index 5b7111fd3..953aa010a 100644
--- a/test/support/conn_case.ex
+++ b/test/support/conn_case.ex
@@ -19,6 +19,8 @@ defmodule Pleroma.Web.ConnCase do
use ExUnit.CaseTemplate
+ alias Pleroma.DataCase
+
using do
quote do
# Import conveniences for testing with connections
@@ -116,27 +118,9 @@ defmodule Pleroma.Web.ConnCase do
end
setup tags do
- :ok = Ecto.Adapters.SQL.Sandbox.checkout(Pleroma.Repo)
-
- if tags[:async] do
- Mox.stub_with(Pleroma.CachexMock, Pleroma.NullCache)
- Mox.set_mox_private()
- else
- Ecto.Adapters.SQL.Sandbox.mode(Pleroma.Repo, {:shared, self()})
- Mox.stub_with(Pleroma.CachexMock, Pleroma.CachexProxy)
- Mox.set_mox_global()
- Pleroma.DataCase.clear_cachex()
- end
-
- if tags[:needs_streamer] do
- start_supervised(%{
- id: Pleroma.Web.Streamer.registry(),
- start:
- {Registry, :start_link, [[keys: :duplicate, name: Pleroma.Web.Streamer.registry()]]}
- })
- end
-
- Pleroma.DataCase.stub_pipeline()
+ DataCase.setup_multi_process_mode(tags)
+ DataCase.setup_streamer(tags)
+ DataCase.stub_pipeline()
Mox.verify_on_exit!()