summaryrefslogtreecommitdiff
path: root/test/web/activity_pub/views
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-02-08 19:58:02 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-02-08 19:58:02 +0300
commitd458f4fdcafe847a7db8b1c663cfd945019816b7 (patch)
tree52f3be61056d6e2e10f296b33bb3aaba75923d55 /test/web/activity_pub/views
parente84fee5b8624c8909ddd8a7e0d99c6beea4f54d0 (diff)
downloadpleroma-d458f4fdcafe847a7db8b1c663cfd945019816b7.tar.gz
pleroma-d458f4fdcafe847a7db8b1c663cfd945019816b7.zip
[#1505] Added tests, changelog entry, tweaked config settings related to replies output on outgoing federation.
Diffstat (limited to 'test/web/activity_pub/views')
-rw-r--r--test/web/activity_pub/views/object_view_test.exs22
1 files changed, 22 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..6784788cc 100644
--- a/test/web/activity_pub/views/object_view_test.exs
+++ b/test/web/activity_pub/views/object_view_test.exs
@@ -36,6 +36,28 @@ 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})
+
+ result = ObjectView.render("object.json", %{object: refresh_record(activity)})
+ replies_uris = [self_reply1.data["id"]]
+
+ assert %{
+ "type" => "Collection",
+ "first" => %{"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)