summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-12-21 16:38:34 +0100
committerlain <lain@soykaf.club>2020-12-21 16:38:34 +0100
commit1a3da01a6505262443d58aba525eda702d7ee575 (patch)
treed8c8edbefd8f319d2ba9bb00d43d44bdd5c459ae
parent5db1e6c8d37ea114433afe0a9247314ab92cc52f (diff)
Tests: Stub the pipeline in all tests.
Restores the old un-moxed behavior.
-rw-r--r--test/support/conn_case.ex2
-rw-r--r--test/support/data_case.ex16
2 files changed, 18 insertions, 0 deletions
diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex
index a7cebf971..02f49c590 100644
--- a/test/support/conn_case.ex
+++ b/test/support/conn_case.ex
@@ -136,6 +136,8 @@ defmodule Pleroma.Web.ConnCase do
})
end
+ Pleroma.DataCase.stub_pipeline()
+
{:ok, conn: Phoenix.ConnTest.build_conn()}
end
end
diff --git a/test/support/data_case.ex b/test/support/data_case.ex
index a3ce9e282..5c657c1d9 100644
--- a/test/support/data_case.ex
+++ b/test/support/data_case.ex
@@ -83,9 +83,25 @@ defmodule Pleroma.DataCase do
})
end
+ stub_pipeline()
+
:ok
end
+ def stub_pipeline do
+ Mox.stub_with(Pleroma.Web.ActivityPub.SideEffectsMock, Pleroma.Web.ActivityPub.SideEffects)
+
+ Mox.stub_with(
+ Pleroma.Web.ActivityPub.ObjectValidatorMock,
+ Pleroma.Web.ActivityPub.ObjectValidator
+ )
+
+ Mox.stub_with(Pleroma.Web.ActivityPub.MRFMock, Pleroma.Web.ActivityPub.MRF)
+ Mox.stub_with(Pleroma.Web.ActivityPub.ActivityPubMock, Pleroma.Web.ActivityPub.ActivityPub)
+ Mox.stub_with(Pleroma.Web.FederatorMock, Pleroma.Web.Federator)
+ Mox.stub_with(Pleroma.ConfigMock, Pleroma.Config)
+ end
+
def ensure_local_uploader(context) do
test_uploader = Map.get(context, :uploader, Pleroma.Uploaders.Local)
uploader = Pleroma.Config.get([Pleroma.Upload, :uploader])