MastoAPI: Add media timelines.
This commit is contained in:
parent
083cd169d2
commit
c84723b679
2 changed files with 24 additions and 0 deletions
|
|
@ -249,6 +249,23 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
|
|||
|
||||
assert id == to_string(note_two.id)
|
||||
end
|
||||
|
||||
test "gets an users media", %{conn: conn} do
|
||||
note = insert(:note_activity)
|
||||
user = User.get_by_ap_id(note.data["actor"])
|
||||
|
||||
file = %Plug.Upload{content_type: "image/jpg", path: Path.absname("test/fixtures/image.jpg"), filename: "an_image.jpg"}
|
||||
media = TwitterAPI.upload(file, "json")
|
||||
|> Poison.decode!
|
||||
|
||||
{:ok, image_post} = TwitterAPI.create_status(user, %{"status" => "cofe", "media_ids" => [media["media_id"]]})
|
||||
|
||||
conn = conn
|
||||
|> get("/api/v1/accounts/#{user.id}/statuses", %{"only_media" => true})
|
||||
|
||||
assert [%{"id" => id}] = json_response(conn, 200)
|
||||
assert id == to_string(image_post.id)
|
||||
end
|
||||
end
|
||||
|
||||
describe "user relationships" do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue