diff options
author | Tusooa Zhu <tusooa@kazv.moe> | 2022-05-29 12:54:57 -0400 |
---|---|---|
committer | Tusooa Zhu <tusooa@kazv.moe> | 2022-05-29 12:54:57 -0400 |
commit | 0f6a5eb9a299629f295372f4d5ecdd9083a19717 (patch) | |
tree | 6da1850c98ae3e8a8f3939336edba9b834676acb /test | |
parent | 547def67a76854aa4c9c8438eb1ee4dfa36fd8ac (diff) | |
download | pleroma-0f6a5eb9a299629f295372f4d5ecdd9083a19717.tar.gz pleroma-0f6a5eb9a299629f295372f4d5ecdd9083a19717.zip |
Handle Note and Question Updates
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/activity_pub/side_effects_test.exs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/pleroma/web/activity_pub/side_effects_test.exs b/test/pleroma/web/activity_pub/side_effects_test.exs index 64c4a8c14..f72753116 100644 --- a/test/pleroma/web/activity_pub/side_effects_test.exs +++ b/test/pleroma/web/activity_pub/side_effects_test.exs @@ -140,6 +140,29 @@ defmodule Pleroma.Web.ActivityPub.SideEffectsTest do end end + describe "update notes" do + setup do + user = insert(:user) + note = insert(:note, user: user) + + updated_note = + note.data + |> Map.put("summary", "edited summary") + |> Map.put("content", "edited content") + + {:ok, update_data, []} = Builder.update(user, updated_note) + {:ok, update, _meta} = ActivityPub.persist(update_data, local: true) + + %{user: user, object_id: note.id, update_data: update_data, update: update} + end + + test "it updates the note", %{object_id: object_id, update: update} do + {:ok, _, _} = SideEffects.handle(update) + new_note = Pleroma.Object.get_by_id(object_id) + assert %{"summary" => "edited summary", "content" => "edited content"} = new_note.data + end + end + describe "EmojiReact objects" do setup do poster = insert(:user) |