don't use global mocks in setup callbacks

This commit is contained in:
Alexander Strizhakov 2020-05-13 09:20:25 +03:00
commit 12635bc156
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
3 changed files with 8 additions and 5 deletions

View file

@ -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 @@ defmodule Pleroma.ActivityTest do
describe "search" do
setup do
Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
user = insert(:user)
params = %{