diff options
Diffstat (limited to 'test/web')
-rw-r--r-- | test/web/salmon/salmon_test.exs | 5 | ||||
-rw-r--r-- | test/web/websub/websub_test.exs | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/test/web/salmon/salmon_test.exs b/test/web/salmon/salmon_test.exs index 1b39b4b2d..3285c11f0 100644 --- a/test/web/salmon/salmon_test.exs +++ b/test/web/salmon/salmon_test.exs @@ -3,6 +3,7 @@ defmodule Pleroma.Web.Salmon.SalmonTest do alias Pleroma.Web.Salmon alias Pleroma.{Repo, Activity, User} import Pleroma.Factory + import Tesla.Mock @magickey "RSA.pu0s-halox4tu7wmES1FVSx6u-4wc0YrUFXcqWXZG4-27UmbCOpMQftRCldNRfyA-qLbz-eqiwQhh-1EwUvjsD4cYbAHNGHwTvDOyx5AKthQUP44ykPv7kjKGh3DWKySJvcs9tlUG87hlo7AvnMo9pwRS_Zz2CacQ-MKaXyDepk=.AQAB" @@ -10,6 +11,10 @@ defmodule Pleroma.Web.Salmon.SalmonTest do @magickey_friendica "RSA.AMwa8FUs2fWEjX0xN7yRQgegQffhBpuKNC6fa5VNSVorFjGZhRrlPMn7TQOeihlc9lBz2OsHlIedbYn2uJ7yCs0.AQAB" + setup do + mock(fn env -> apply(HttpRequestMock, :request, [env]) end) + :ok + end test "decodes a salmon" do {:ok, salmon} = File.read("test/fixtures/salmon.xml") {:ok, doc} = Salmon.decode_and_validate(@magickey, salmon) diff --git a/test/web/websub/websub_test.exs b/test/web/websub/websub_test.exs index f3d2da81a..47d1a88e1 100644 --- a/test/web/websub/websub_test.exs +++ b/test/web/websub/websub_test.exs @@ -13,13 +13,7 @@ defmodule Pleroma.Web.WebsubTest do import Tesla.Mock setup do - mock fn - %{method: :get, url: "https://mastodon.social/users/lambadalambda.atom"} -> - %Tesla.Env{status: 200, body: File.read!("test/fixtures/lambadalambda.atom")} - %{method: :post, url: "http://example.org/needs_refresh"} -> - %Tesla.Env{status: 200, body: ""} - end - + mock(fn env -> apply(HttpRequestMock, :request, [env]) end) :ok end |