[#1505] Added tests, changelog entry, tweaked config settings related to replies output on outgoing federation.
This commit is contained in:
parent
e84fee5b86
commit
d458f4fdca
7 changed files with 45 additions and 26 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue