mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-02 09:45:13 +00:00
32 lines
647 B
Elixir
32 lines
647 B
Elixir
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"
|
|
}
|
|
],
|
|
"uuid" => 6
|
|
}
|
|
}
|
|
|
|
expected_object = %{
|
|
id: 6,
|
|
url: "someurl",
|
|
mimetype: "sometype",
|
|
oembed: false
|
|
}
|
|
|
|
assert expected_object == ObjectRepresenter.to_map(object)
|
|
end
|
|
end
|