diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2019-01-29 05:11:08 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2019-01-29 05:11:08 +0000 |
commit | ebb3496386c1e195b48bcdc9d72c4c30e60fe340 (patch) | |
tree | 47e7c0be6bcf4615e9dd3db7ad66a2f65757c69f /test/web/mastodon_api/mastodon_api_controller_test.exs | |
parent | 009273fd6e4d14601ebd9f02f2fd797716f774ed (diff) | |
parent | 61d6715714fe9c2ce6bf4fe6afc353f7fe5502a6 (diff) | |
download | pleroma-ebb3496386c1e195b48bcdc9d72c4c30e60fe340.tar.gz pleroma-ebb3496386c1e195b48bcdc9d72c4c30e60fe340.zip |
Merge branch 'feature/rich-media-part-2-electric-boogaloo' into 'develop'
Rich Media support, part 2.
See merge request pleroma/pleroma!719
Diffstat (limited to 'test/web/mastodon_api/mastodon_api_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index b8f901e6c..1a5eb090c 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -136,6 +136,20 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert Repo.get(Activity, id) end + test "posting a status with OGP link preview", %{conn: conn} do + user = insert(:user) + + conn = + conn + |> assign(:user, user) + |> post("/api/v1/statuses", %{ + "status" => "http://example.com/ogp" + }) + + assert %{"id" => id, "card" => %{"title" => "The Rock"}} = json_response(conn, 200) + assert Repo.get(Activity, id) + end + test "posting a direct status", %{conn: conn} do user1 = insert(:user) user2 = insert(:user) @@ -1663,9 +1677,19 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert response == %{ "image" => "http://ia.media-imdb.com/images/rock.jpg", "provider_name" => "www.imdb.com", + "provider_url" => "http://www.imdb.com", "title" => "The Rock", "type" => "link", - "url" => "http://www.imdb.com/title/tt0117500/" + "url" => "http://www.imdb.com/title/tt0117500/", + "description" => nil, + "pleroma" => %{ + "opengraph" => %{ + "image" => "http://ia.media-imdb.com/images/rock.jpg", + "title" => "The Rock", + "type" => "video.movie", + "url" => "http://www.imdb.com/title/tt0117500/" + } + } } end end |