diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2019-01-14 00:06:55 +0100 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2019-01-26 14:18:23 +0000 |
commit | 3f64379b1382f2e26cacd28da230c67bf68656a0 (patch) | |
tree | f8e970e40675e6d79fefc07ef7acb8bf2259da22 /test | |
parent | d9f3af477d687fb8cb469ec652586911ad51d0b0 (diff) | |
download | pleroma-3f64379b1382f2e26cacd28da230c67bf68656a0.tar.gz pleroma-3f64379b1382f2e26cacd28da230c67bf68656a0.zip |
Web.MastodonAPI.MastodonAPIController: Add Rich-Media support
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 6004285d6..bc87383f7 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -1623,5 +1623,21 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> post("/api/v1/statuses/#{activity_two.id}/pin") |> json_response(400) end + + test "Status rich-media Card", %{conn: conn, user: user} do + {:ok, activity} = CommonAPI.post(user, %{"status" => "http://example.com/ogp"}) + + response = + conn + |> get("/api/v1/statuses/#{activity.id}/card") + |> json_response(200) + + assert response == %{ + "image" => "http://ia.media-imdb.com/images/rock.jpg", + "title" => "The Rock", + "type" => "link", + "url" => "http://www.imdb.com/title/tt0117500/" + } + end end end |