Merge branch 'feature/ostatus-removal' into 'develop'
[akkoma] / test / web / mastodon_api / views / status_view_test.exs
index 1d5a6e956db95d7be1edbc792c032f2e59145d92..c200ad8feb6d353cb1499da5e5060581c6f49a5d 100644 (file)
@@ -14,7 +14,6 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
   alias Pleroma.Web.CommonAPI.Utils
   alias Pleroma.Web.MastodonAPI.AccountView
   alias Pleroma.Web.MastodonAPI.StatusView
-  alias Pleroma.Web.OStatus
   import Pleroma.Factory
   import Tesla.Mock
 
@@ -230,17 +229,15 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
   end
 
   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})
+    user = insert(:user)
+    mentioned = insert(:user)
 
-    {:ok, [activity]} = OStatus.handle_incoming(incoming)
+    {:ok, activity} = CommonAPI.post(user, %{"status" => "hi @#{mentioned.nickname}"})
 
     status = StatusView.render("show.json", %{activity: activity})
 
     assert status.mentions ==
-             Enum.map([user], fn u -> AccountView.render("mention.json", %{user: u}) end)
+             Enum.map([mentioned], fn u -> AccountView.render("mention.json", %{user: u}) end)
   end
 
   test "create mentions from the 'to' field" do