X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Factivity_pub%2Fviews%2Fobject_view_test.exs;h=9348c09beff6ee94b9eb45d384fe827e71be2c90;hb=63ce25f32c9bd0dfd5a4db9ad14b6b773c9b05a9;hp=f0389845dafd5733f5755673eaeb0e4dc1dd49c7;hpb=049ece1ef38f1aeb656a88ed1d15bf3d4a364e01;p=akkoma
diff --git a/test/pleroma/web/activity_pub/views/object_view_test.exs b/test/pleroma/web/activity_pub/views/object_view_test.exs
index f0389845d..9348c09be 100644
--- a/test/pleroma/web/activity_pub/views/object_view_test.exs
+++ b/test/pleroma/web/activity_pub/views/object_view_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectViewTest do
@@ -24,7 +24,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectViewTest do
test "renders a note activity" do
note = insert(:note_activity)
- object = Object.normalize(note)
+ object = Object.normalize(note, fetch: false)
result = ObjectView.render("object.json", %{object: note})
@@ -56,7 +56,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectViewTest do
test "renders a like activity" do
note = insert(:note_activity)
- object = Object.normalize(note)
+ object = Object.normalize(note, fetch: false)
user = insert(:user)
{:ok, like_activity} = CommonAPI.favorite(user, note.id)
@@ -70,7 +70,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectViewTest do
test "renders an announce activity" do
note = insert(:note_activity)
- object = Object.normalize(note)
+ object = Object.normalize(note, fetch: false)
user = insert(:user)
{:ok, announce_activity} = CommonAPI.repeat(note.id, user)
@@ -81,4 +81,18 @@ defmodule Pleroma.Web.ActivityPub.ObjectViewTest do
assert result["object"] == object.data["id"]
assert result["type"] == "Announce"
end
+
+ test "renders an undo announce activity" do
+ note = insert(:note_activity)
+ user = insert(:user)
+
+ {:ok, announce} = CommonAPI.repeat(note.id, user)
+ {:ok, undo} = CommonAPI.unrepeat(note.id, user)
+
+ result = ObjectView.render("object.json", %{object: undo})
+
+ assert result["id"] == undo.data["id"]
+ assert result["object"] == announce.data["id"]
+ assert result["type"] == "Undo"
+ end
end