<< hash_id::signed-32, _rest::binary >> = :crypto.hash(:md5, href)
%{
- id: attachment["id"] || hash_id,
+ id: to_string(attachment["id"] || hash_id),
url: href,
remote_url: href,
preview_url: href,
}
expected = %{
- id: 1638338801,
+ id: "1638338801",
type: "image",
url: "someurl",
remote_url: "someurl",
# If theres a "id", use that instead of the generated one
object = Map.put(object, "id", 2)
- assert %{id: 2} = StatusView.render("attachment.json", %{attachment: object})
+ assert %{id: "2"} = StatusView.render("attachment.json", %{attachment: object})
end
test "a reblog" do