diff options
Diffstat (limited to 'test/web/salmon/salmon_test.exs')
-rw-r--r-- | test/web/salmon/salmon_test.exs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/test/web/salmon/salmon_test.exs b/test/web/salmon/salmon_test.exs index 1b39b4b2d..c539a28b2 100644 --- a/test/web/salmon/salmon_test.exs +++ b/test/web/salmon/salmon_test.exs @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/> +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Web.Salmon.SalmonTest do use Pleroma.DataCase alias Pleroma.Web.Salmon @@ -10,6 +14,11 @@ defmodule Pleroma.Web.Salmon.SalmonTest do @magickey_friendica "RSA.AMwa8FUs2fWEjX0xN7yRQgegQffhBpuKNC6fa5VNSVorFjGZhRrlPMn7TQOeihlc9lBz2OsHlIedbYn2uJ7yCs0.AQAB" + setup_all do + Tesla.Mock.mock_global(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) @@ -69,7 +78,7 @@ defmodule Pleroma.Web.Salmon.SalmonTest do test "it pushes an activity to remote accounts it's addressed to" do user_data = %{ info: %{ - "salmon" => "http://example.org/salmon" + salmon: "http://test-example.org/salmon" }, local: false } @@ -91,8 +100,8 @@ defmodule Pleroma.Web.Salmon.SalmonTest do user = Repo.get_by(User, ap_id: activity.data["actor"]) {:ok, user} = Pleroma.Web.WebFinger.ensure_keys_present(user) - poster = fn url, _data, _headers, _options -> - assert url == "http://example.org/salmon" + poster = fn url, _data, _headers -> + assert url == "http://test-example.org/salmon" end Salmon.publish(user, activity, poster) |