diff options
Diffstat (limited to 'test/web/ostatus')
-rw-r--r-- | test/web/ostatus/activity_representer_test.exs | 6 | ||||
-rw-r--r-- | test/web/ostatus/ostatus_controller_test.exs | 5 | ||||
-rw-r--r-- | test/web/ostatus/ostatus_test.exs | 7 |
3 files changed, 17 insertions, 1 deletions
diff --git a/test/web/ostatus/activity_representer_test.exs b/test/web/ostatus/activity_representer_test.exs index 8bf3bc775..a351510d8 100644 --- a/test/web/ostatus/activity_representer_test.exs +++ b/test/web/ostatus/activity_representer_test.exs @@ -7,6 +7,12 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenterTest do alias Pleroma.Web.OStatus import Pleroma.Factory + import Tesla.Mock + + setup do + mock(fn env -> apply(HttpRequestMock, :request, [env]) end) + :ok + end test "an external note activity" do incoming = File.read!("test/fixtures/mastodon-note-cw.xml") diff --git a/test/web/ostatus/ostatus_controller_test.exs b/test/web/ostatus/ostatus_controller_test.exs index e81adde68..411e89e94 100644 --- a/test/web/ostatus/ostatus_controller_test.exs +++ b/test/web/ostatus/ostatus_controller_test.exs @@ -5,6 +5,11 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do alias Pleroma.Web.CommonAPI alias Pleroma.Web.OStatus.ActivityRepresenter + setup_all do + Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end) + :ok + end + test "decodes a salmon", %{conn: conn} do user = insert(:user) salmon = File.read!("test/fixtures/salmon.xml") diff --git a/test/web/ostatus/ostatus_test.exs b/test/web/ostatus/ostatus_test.exs index baa8cac72..f3268e83d 100644 --- a/test/web/ostatus/ostatus_test.exs +++ b/test/web/ostatus/ostatus_test.exs @@ -6,6 +6,11 @@ defmodule Pleroma.Web.OStatusTest do import Pleroma.Factory import ExUnit.CaptureLog + setup_all do + Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end) + :ok + end + test "don't insert create notes twice" do incoming = File.read!("test/fixtures/incoming_note_activity.xml") {:ok, [activity]} = OStatus.handle_incoming(incoming) @@ -337,7 +342,7 @@ defmodule Pleroma.Web.OStatusTest do %Pleroma.User.Info{ id: user.info.id, ap_enabled: false, - background: nil, + background: %{}, banner: %{}, blocks: [], deactivated: false, |