summaryrefslogtreecommitdiff
path: root/test/web/activity_pub/views
diff options
context:
space:
mode:
authorAlexander Strizhakov <alex.strizhakov@gmail.com>2020-02-29 11:34:50 +0300
committerAlexander Strizhakov <alex.strizhakov@gmail.com>2020-02-29 11:34:50 +0300
commit814b275af7748df6bd11dfc6be1b4efce8d5ae70 (patch)
treee18b30dfa6eb020e593dbe1cc0e649da3e6ed394 /test/web/activity_pub/views
parent6b012ddd69aec0f85c22ad91dbb76e05f2edaf58 (diff)
parentaad057a2d6baaa342f47f55d330f0731277dac06 (diff)
downloadpleroma-814b275af7748df6bd11dfc6be1b4efce8d5ae70.tar.gz
pleroma-814b275af7748df6bd11dfc6be1b4efce8d5ae70.zip
Merge branch 'develop' into gun
Diffstat (limited to 'test/web/activity_pub/views')
-rw-r--r--test/web/activity_pub/views/object_view_test.exs20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/web/activity_pub/views/object_view_test.exs b/test/web/activity_pub/views/object_view_test.exs
index 13447dc29..acc855b98 100644
--- a/test/web/activity_pub/views/object_view_test.exs
+++ b/test/web/activity_pub/views/object_view_test.exs
@@ -36,6 +36,26 @@ defmodule Pleroma.Web.ActivityPub.ObjectViewTest do
assert result["@context"]
end
+ describe "note activity's `replies` collection rendering" do
+ clear_config([:activitypub, :note_replies_output_limit]) do
+ Pleroma.Config.put([:activitypub, :note_replies_output_limit], 5)
+ end
+
+ test "renders `replies` collection for a note activity" do
+ user = insert(:user)
+ activity = insert(:note_activity, user: user)
+
+ {:ok, self_reply1} =
+ CommonAPI.post(user, %{"status" => "self-reply 1", "in_reply_to_status_id" => activity.id})
+
+ replies_uris = [self_reply1.object.data["id"]]
+ result = ObjectView.render("object.json", %{object: refresh_record(activity)})
+
+ assert %{"type" => "Collection", "items" => ^replies_uris} =
+ get_in(result, ["object", "replies"])
+ end
+ end
+
test "renders a like activity" do
note = insert(:note_activity)
object = Object.normalize(note)