summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api
diff options
context:
space:
mode:
Diffstat (limited to 'test/web/mastodon_api')
-rw-r--r--test/web/mastodon_api/mastodon_api_controller_test.exs4
-rw-r--r--test/web/mastodon_api/status_view_test.exs4
2 files changed, 5 insertions, 3 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs
index fc0010569..8bfad5265 100644
--- a/test/web/mastodon_api/mastodon_api_controller_test.exs
+++ b/test/web/mastodon_api/mastodon_api_controller_test.exs
@@ -145,7 +145,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
|> assign(:user, user)
|> get("/api/v1/notifications")
- expected_response = "hi <a href=\"#{user.ap_id}\">@#{user.nickname}</a>"
+ expected_response = "hi <span><a href=\"#{user.ap_id}\">@<span>#{user.nickname}</span></a></span>"
assert [%{"status" => %{"content" => response}} | _rest] = json_response(conn, 200)
assert response == expected_response
end
@@ -161,7 +161,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
|> assign(:user, user)
|> get("/api/v1/notifications/#{notification.id}")
- expected_response = "hi <a href=\"#{user.ap_id}\">@#{user.nickname}</a>"
+ expected_response = "hi <span><a href=\"#{user.ap_id}\">@<span>#{user.nickname}</span></a></span>"
assert %{"status" => %{"content" => response}} = json_response(conn, 200)
assert response == expected_response
end
diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs
index 93c0b7236..0d396f3b8 100644
--- a/test/web/mastodon_api/status_view_test.exs
+++ b/test/web/mastodon_api/status_view_test.exs
@@ -56,7 +56,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
test "contains mentions" do
incoming = File.read!("test/fixtures/incoming_reply_mastodon.xml")
- user = insert(:user, %{ap_id: "https://pleroma.soykaf.com/users/lain"})
+ # a user with this ap id might be in the cache.
+ recipient = "https://pleroma.soykaf.com/users/lain"
+ user = User.get_cached_by_ap_id(recipient) || insert(:user, %{ap_id: recipient})
{:ok, [activity]} = OStatus.handle_incoming(incoming)