aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2019-10-18 15:46:46 +0000
committerAriadne Conill <ariadne@dereferenced.org>2019-10-18 15:46:46 +0000
commitc2ae6310dc09e65515c7b8774d2b85b5ef7da1a1 (patch)
tree31075bdd659c45b688e3b670acc5c9b41a7abc63
parent44e64af5e76e1ace82aa66973da883e334ebfc93 (diff)
downloadpleroma-c2ae6310dc09e65515c7b8774d2b85b5ef7da1a1.tar.gz
tests: mastodon api: fix broken test that used OStatus
-rw-r--r--test/web/mastodon_api/views/status_view_test.exs25
1 files changed, 11 insertions, 14 deletions
diff --git a/test/web/mastodon_api/views/status_view_test.exs b/test/web/mastodon_api/views/status_view_test.exs
index 9375c5030..c200ad8fe 100644
--- a/test/web/mastodon_api/views/status_view_test.exs
+++ b/test/web/mastodon_api/views/status_view_test.exs
@@ -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)