mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-18 19:14:03 +00:00
don't use global mocks in setup callbacks
This commit is contained in:
parent
b962b24e6f
commit
12635bc156
|
@ -11,6 +11,11 @@ defmodule Pleroma.ActivityTest do
|
|||
alias Pleroma.ThreadMute
|
||||
import Pleroma.Factory
|
||||
|
||||
setup_all do
|
||||
Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
|
||||
:ok
|
||||
end
|
||||
|
||||
test "returns an activity by it's AP id" do
|
||||
activity = insert(:note_activity)
|
||||
found_activity = Activity.get_by_ap_id(activity.data["id"])
|
||||
|
@ -107,8 +112,6 @@ test "when association is not loaded" do
|
|||
|
||||
describe "search" do
|
||||
setup do
|
||||
Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
|
||||
|
||||
user = insert(:user)
|
||||
|
||||
params = %{
|
||||
|
|
|
@ -13,7 +13,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
|
|||
import Tesla.Mock
|
||||
import Mock
|
||||
|
||||
setup do
|
||||
setup_all do
|
||||
mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
|
||||
:ok
|
||||
end
|
||||
|
|
|
@ -13,8 +13,8 @@ defmodule Pleroma.Web.Push.ImplTest do
|
|||
|
||||
import Pleroma.Factory
|
||||
|
||||
setup_all do
|
||||
Tesla.Mock.mock_global(fn
|
||||
setup do
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: :post, url: "https://example.com/example/1234"} ->
|
||||
%Tesla.Env{status: 200}
|
||||
|
||||
|
|
Loading…
Reference in a new issue