Merge branch 'support/bugfix_272' into 'develop'
[akkoma] / test / web / mastodon_api / status_view_test.exs
index b29f13e2024242efbda8f9646a783ea9d4011c3f..d10d59d6c75cdbb6ee0d501135372c6d103ee952 100644 (file)
@@ -6,15 +6,25 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
   alias Pleroma.Web.OStatus
   alias Pleroma.Web.CommonAPI
   import Pleroma.Factory
+  import Tesla.Mock
+
+  setup do
+    mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
+    :ok
+  end
 
   test "a note with null content" do
     note = insert(:note_activity)
-    data = note.data
-    |> put_in(["object", "content"], nil)
-    note = note
-    |> Map.put(:data, data)
 
-    user = User.get_cached_by_ap_id(note.data["actor"])
+    data =
+      note.data
+      |> put_in(["object", "content"], nil)
+
+    note =
+      note
+      |> Map.put(:data, data)
+
+    User.get_cached_by_ap_id(note.data["actor"])
 
     status = StatusView.render("status.json", %{activity: note})
 
@@ -52,7 +62,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
       visibility: "public",
       media_attachments: [],
       mentions: [],
-      tags: [],
+      tags: note.data["object"]["tag"],
       application: %{
         name: "Web",
         website: nil