Fix URL generated for backup files, try to create a source of truth we can reuse...
[akkoma] / test / support / conn_case.ex
index b5bd71809a195089fc1fbc098721154d83733346..f20e3d955e33dafcdd1728da1bc24d4372b3e4df 100644 (file)
@@ -118,8 +118,13 @@ defmodule Pleroma.Web.ConnCase do
   setup tags do
     :ok = Ecto.Adapters.SQL.Sandbox.checkout(Pleroma.Repo)
 
-    unless tags[:async] do
+    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
 
@@ -131,6 +136,10 @@ defmodule Pleroma.Web.ConnCase do
       })
     end
 
+    Pleroma.DataCase.stub_pipeline()
+
+    Mox.verify_on_exit!()
+
     {:ok, conn: Phoenix.ConnTest.build_conn()}
   end
 end