Merge branch 'develop' into feature/database-compaction
[akkoma] / test / web / mastodon_api / status_view_test.exs
index db2fdc2f6dda92a15df7e0f3020ee301f5c387fe..4ea50c7c698dbeec43d33f7b9287b9e0ea3b703b 100644 (file)
@@ -7,6 +7,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
 
   alias Pleroma.Activity
   alias Pleroma.User
+  alias Pleroma.Repo
+  alias Pleroma.Object
   alias Pleroma.Web.ActivityPub.ActivityPub
   alias Pleroma.Web.CommonAPI
   alias Pleroma.Web.CommonAPI.Utils
@@ -53,14 +55,14 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
 
   test "a note with null content" do
     note = insert(:note_activity)
+    note_object = Object.normalize(note.data["object"])
 
     data =
-      note.data
-      |> put_in(["object", "content"], nil)
+      note_object.data
+      |> Map.put("content", nil)
 
-    note =
-      note
-      |> Map.put(:data, data)
+    Object.change(note_object, %{data: data})
+    |> Repo.update()
 
     User.get_cached_by_ap_id(note.data["actor"])