diff options
author | Mark Felder <feld@feld.me> | 2024-05-08 01:44:58 +0000 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2024-05-08 01:44:58 +0000 |
commit | 19002fd6c11760898daf0b5ed648d6ba58d84b97 (patch) | |
tree | 731bf286c970382de6ce2f1dde2047cf05940ebb /test | |
parent | 37de58823f8c7ec45921ea16fc7b5a2e25d27ad1 (diff) | |
download | pleroma-19002fd6c11760898daf0b5ed648d6ba58d84b97.tar.gz pleroma-19002fd6c11760898daf0b5ed648d6ba58d84b97.zip |
Mastodon API: Remove deprecated GET /api/v1/statuses/:id/card endpoint
Removed back in 2019
https://github.com/mastodon/mastodon/pull/11213
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/mastodon_api/controllers/status_controller_test.exs | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs index 3a94b65b9..80c1ed099 100644 --- a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs @@ -1643,63 +1643,6 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do end end - describe "cards" do - setup do - Pleroma.StaticStubbedConfigMock - |> stub(:get, fn - [:rich_media, :enabled] -> true - path -> Pleroma.Test.StaticConfig.get(path) - end) - - oauth_access(["read:statuses"]) - end - - test "returns rich-media card", %{conn: conn, user: user} do - Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end) - - {:ok, activity} = CommonAPI.post(user, %{status: "https://example.com/ogp"}) - - card_data = %{ - "image" => "http://ia.media-imdb.com/images/rock.jpg", - "provider_name" => "example.com", - "provider_url" => "https://example.com", - "title" => "The Rock", - "type" => "link", - "url" => "https://example.com/ogp", - "description" => - "Directed by Michael Bay. With Sean Connery, Nicolas Cage, Ed Harris, John Spencer.", - "pleroma" => %{ - "opengraph" => %{ - "image" => "http://ia.media-imdb.com/images/rock.jpg", - "title" => "The Rock", - "type" => "video.movie", - "url" => "https://example.com/ogp", - "description" => - "Directed by Michael Bay. With Sean Connery, Nicolas Cage, Ed Harris, John Spencer." - } - } - } - - response = - conn - |> get("/api/v1/statuses/#{activity.id}/card") - |> json_response_and_validate_schema(200) - - assert response == card_data - - # works with private posts - {:ok, activity} = - CommonAPI.post(user, %{status: "https://example.com/ogp", visibility: "direct"}) - - response_two = - conn - |> get("/api/v1/statuses/#{activity.id}/card") - |> json_response_and_validate_schema(200) - - assert response_two == card_data - end - end - test "bookmarks" do bookmarks_uri = "/api/v1/bookmarks" |