Twitter Representers: Handle Mastodon attachments.
This commit is contained in:
parent
ae1ec858f4
commit
ce31f3a922
2 changed files with 34 additions and 2 deletions
|
|
@ -28,4 +28,24 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ObjectReprenterTest do
|
|||
|
||||
assert expected_object == ObjectRepresenter.to_map(object)
|
||||
end
|
||||
|
||||
test "represents mastodon-style attachments" do
|
||||
object = %Object{
|
||||
id: nil,
|
||||
data: %{
|
||||
"mediaType" => "image/png",
|
||||
"name" => "blabla", "type" => "Document",
|
||||
"url" => "http://mastodon.example.org/system/media_attachments/files/000/000/001/original/8619f31c6edec470.png"
|
||||
}
|
||||
}
|
||||
|
||||
expected_object = %{
|
||||
url: "http://mastodon.example.org/system/media_attachments/files/000/000/001/original/8619f31c6edec470.png",
|
||||
mimetype: "image/png",
|
||||
oembed: false,
|
||||
id: nil
|
||||
}
|
||||
|
||||
assert expected_object == ObjectRepresenter.to_map(object)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue