BuilderTest: build quote post

This commit is contained in:
Alex Gleason 2022-01-22 22:29:13 -06:00 committed by tusooa
parent d4fea8b559
commit c20e90e898
No known key found for this signature in database
GPG Key ID: 42AEC43D48433C51
1 changed files with 29 additions and 0 deletions

View File

@ -44,5 +44,34 @@ test "returns note data" do
assert {:ok, ^expected, []} = Builder.note(draft)
end
test "quote post" do
user = insert(:user)
note = insert(:note)
draft = %ActivityDraft{
user: user,
context: "2hu",
content_html: "<h1>This is :moominmamma: note</h1>",
quote_post: note,
extra: %{}
}
expected = %{
"actor" => user.ap_id,
"attachment" => [],
"content" => "<h1>This is :moominmamma: note</h1>",
"context" => "2hu",
"sensitive" => false,
"type" => "Note",
"quoteUrl" => note.data["id"],
"cc" => [],
"summary" => nil,
"tag" => [],
"to" => []
}
assert {:ok, ^expected, []} = Builder.note(draft)
end
end
end