From c1277be041167be255e966eebf95a5137f49e34b Mon Sep 17 00:00:00 2001 From: lain Date: Wed, 19 Aug 2020 14:36:42 +0200 Subject: [PATCH] AudioHandlingTest: Make mock explicit --- .../transmogrifier/audio_handling_test.exs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/web/activity_pub/transmogrifier/audio_handling_test.exs b/test/web/activity_pub/transmogrifier/audio_handling_test.exs index 9cb53c48b..0636d00c5 100644 --- a/test/web/activity_pub/transmogrifier/audio_handling_test.exs +++ b/test/web/activity_pub/transmogrifier/audio_handling_test.exs @@ -12,11 +12,6 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.AudioHandlingTest do import Pleroma.Factory - setup_all do - Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end) - :ok - end - test "it works for incoming listens" do _user = insert(:user, ap_id: "http://mastodon.example.org/users/admin") @@ -49,6 +44,14 @@ test "it works for incoming listens" do end test "Funkwhale Audio object" do + Tesla.Mock.mock(fn + %{url: "https://channels.tests.funkwhale.audio/federation/actors/compositions"} -> + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/tesla_mock/funkwhale_channel.json") + } + end) + data = File.read!("test/fixtures/tesla_mock/funkwhale_create_audio.json") |> Poison.decode!() {:ok, %Activity{local: false} = activity} = Transmogrifier.handle_incoming(data)