Tests: Stub the pipeline in all tests.
authorlain <lain@soykaf.club>
Mon, 21 Dec 2020 15:38:34 +0000 (16:38 +0100)
committerlain <lain@soykaf.club>
Mon, 21 Dec 2020 15:38:34 +0000 (16:38 +0100)
Restores the old un-moxed behavior.

test/support/conn_case.ex
test/support/data_case.ex

index a7cebf9714f3a847bc404cb507d504e33a6576aa..02f49c5906a2847c4c2d6aff7d8c0b1b95512765 100644 (file)
@@ -136,6 +136,8 @@ defmodule Pleroma.Web.ConnCase do
       })
     end
 
+    Pleroma.DataCase.stub_pipeline()
+
     {:ok, conn: Phoenix.ConnTest.build_conn()}
   end
 end
index a3ce9e282c8f942bf8471e93e714e7c17ef771bd..5c657c1d92cd9a656249ba80c8da8ba08d31018c 100644 (file)
@@ -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])