[#114] Added email confirmation resend action. Added tests
[akkoma] / test / web / activity_pub / activity_pub_controller_test.exs
index d8c5badb871e019ec47be7b2d8e7385df57cb3ab..faeace0160022167c2efb69e4e3ca69a428a44fa 100644 (file)
@@ -5,6 +5,11 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
   alias Pleroma.{Repo, User}
   alias Pleroma.Activity
 
+  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
       res =
@@ -18,10 +23,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
     test "with the relay disabled, it returns 404", %{conn: conn} do
       Pleroma.Config.put([:instance, :allow_relay], false)
 
-      res =
-        conn
-        |> get(activity_pub_path(conn, :relay))
-        |> json_response(404)
+      conn
+      |> get(activity_pub_path(conn, :relay))
+      |> json_response(404)
+      |> assert
 
       Pleroma.Config.put([:instance, :allow_relay], true)
     end