Add attachments to mastoapi statuses.
This commit is contained in:
parent
96473dfac0
commit
fc10875895
2 changed files with 46 additions and 2 deletions
|
|
@ -2,7 +2,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
|||
use Pleroma.DataCase
|
||||
|
||||
alias Pleroma.Web.MastodonAPI.{StatusView, AccountView}
|
||||
alias Pleroma.User
|
||||
alias Pleroma.{User, Object}
|
||||
alias Pleroma.Web.OStatus
|
||||
import Pleroma.Factory
|
||||
|
||||
|
|
@ -50,4 +50,28 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
|||
|
||||
assert status.mentions == [AccountView.render("mention.json", %{user: user})]
|
||||
end
|
||||
|
||||
test "attachments" do
|
||||
incoming = File.read!("test/fixtures/incoming_reply_mastodon.xml")
|
||||
object = %{
|
||||
"type" => "Image",
|
||||
"url" => [
|
||||
%{
|
||||
"mediaType" => "image/png",
|
||||
"href" => "someurl"
|
||||
}
|
||||
],
|
||||
"uuid" => 6
|
||||
}
|
||||
|
||||
expected = %{
|
||||
id: 6,
|
||||
type: "image",
|
||||
url: "someurl",
|
||||
remote_url: "someurl",
|
||||
preview_url: "someurl"
|
||||
}
|
||||
|
||||
assert expected == StatusView.render("attachment.json", %{attachment: object})
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue