resolved activity view test
[akkoma] / test / web / activity_pub / activity_pub_controller_test.exs
index 5b46bbe768e6cdb2e188e6d06d26015615553e71..980f43553b6810e9ffd2616fbbfa273f7a1d1053 100644 (file)
@@ -4,12 +4,14 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
   alias Pleroma.Web.ActivityPub.{UserView, ObjectView}
   alias Pleroma.{Repo, User}
   alias Pleroma.Activity
-  alias Pleroma.Config
+
+  setup_all do
+    Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
+    :ok
+  end
 
   describe "/relay" do
     test "with the relay active, it returns the relay user", %{conn: conn} do
-      Config.put([:instance, :allow_relay], true)
-
       res =
         conn
         |> get(activity_pub_path(conn, :relay))
@@ -19,12 +21,14 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
     end
 
     test "with the relay disabled, it returns 404", %{conn: conn} do
-      Config.put([:instance, :allow_relay], false)
+      Pleroma.Config.put([:instance, :allow_relay], false)
 
       res =
         conn
         |> get(activity_pub_path(conn, :relay))
         |> json_response(404)
+
+      Pleroma.Config.put([:instance, :allow_relay], true)
     end
   end