Remove TwitterAPI representers
This commit is contained in:
parent
2e7bb107e0
commit
64410497d2
3 changed files with 0 additions and 137 deletions
|
|
@ -1,60 +0,0 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
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,
|
||||
description: nil
|
||||
}
|
||||
|
||||
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,
|
||||
description: "blabla"
|
||||
}
|
||||
|
||||
assert expected_object == ObjectRepresenter.to_map(object)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue