BuilderTest: build quote post
This commit is contained in:
parent
d4fea8b559
commit
c20e90e898
|
@ -44,5 +44,34 @@ test "returns note data" do
|
||||||
|
|
||||||
assert {:ok, ^expected, []} = Builder.note(draft)
|
assert {:ok, ^expected, []} = Builder.note(draft)
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue