Basic ObjectRepresenter.

This commit is contained in:
Roger Braun 2017-03-30 16:08:49 +02:00
commit 42c90855ba
2 changed files with 45 additions and 0 deletions

View file

@ -0,0 +1,30 @@
defmodule Pleroma.Web.TwitterAPI.Representers.ObjectReprenterTest do
use Pleroma.DataCase
alias Pleroma.Object
alias Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter
test "represent an image attachment" do
object = %Object{
id: 5,
data: %{
"type" => "Image",
"url" => [
%{
"mediaType" => "sometype",
"href" => "someurl"
}
]
}
}
expected_object = %{
id: 5,
url: "someurl",
mimetype: "sometype",
oembed: false
}
assert expected_object == ObjectRepresenter.to_map(object)
end
end