Browse Source

tests: mastodon api: fix broken test that used OStatus

merge-requests/1875/head
Ariadne Conill 4 years ago
parent
commit
c2ae6310dc
1 changed files with 11 additions and 14 deletions
  1. +11
    -14
      test/web/mastodon_api/views/status_view_test.exs

+ 11
- 14
test/web/mastodon_api/views/status_view_test.exs View File

@@ -228,20 +228,17 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
assert status.in_reply_to_id == to_string(note.id)
end

# XXX: fix this test
# test "contains mentions" do
# incoming = File.read!("test/fixtures/incoming_reply_mastodon.xml")
# # a user with this ap id might be in the cache.
# recipient = "https://pleroma.soykaf.com/users/lain"
# user = insert(:user, %{ap_id: recipient})
#
# {:ok, [activity]} = OStatus.handle_incoming(incoming)
#
# status = StatusView.render("show.json", %{activity: activity})
#
# assert status.mentions ==
# Enum.map([user], fn u -> AccountView.render("mention.json", %{user: u}) end)
# end
test "contains mentions" do
user = insert(:user)
mentioned = insert(:user)

{:ok, activity} = CommonAPI.post(user, %{"status" => "hi @#{mentioned.nickname}"})

status = StatusView.render("show.json", %{activity: activity})

assert status.mentions ==
Enum.map([mentioned], fn u -> AccountView.render("mention.json", %{user: u}) end)
end

test "create mentions from the 'to' field" do
%User{ap_id: recipient_ap_id} = insert(:user)


Loading…
Cancel
Save