diff options
author | Mark Felder <feld@feld.me> | 2024-05-08 00:23:59 +0000 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2024-05-08 00:23:59 +0000 |
commit | fa66bd95dc5a24e626a183cc5fab593ea87b14b7 (patch) | |
tree | e83b075fa4a95f690e9c4f8af80d88232ab9014c /test | |
parent | 5a5a193877dd890db5682d1809e02d4908d11144 (diff) | |
download | pleroma-fa66bd95dc5a24e626a183cc5fab593ea87b14b7.tar.gz pleroma-fa66bd95dc5a24e626a183cc5fab593ea87b14b7.zip |
Rich Media Cards are cached by URL not per status
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/mastodon_api/controllers/status_controller_test.exs | 34 |
1 files changed, 0 insertions, 34 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 3d8a0fa99..5b20f6647 100644 --- a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs @@ -329,40 +329,6 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do assert real_status == fake_status end - test "fake statuses' preview card is not cached", %{conn: conn} do - Pleroma.StaticStubbedConfigMock - |> stub(:get, fn - [:rich_media, :enabled] -> true - path -> Pleroma.Test.StaticConfig.get(path) - end) - - Tesla.Mock.mock_global(fn - env -> - apply(HttpRequestMock, :request, [env]) - end) - - conn1 = - conn - |> put_req_header("content-type", "application/json") - |> post("/api/v1/statuses", %{ - "status" => "https://example.com/ogp", - "preview" => true - }) - - conn2 = - conn - |> put_req_header("content-type", "application/json") - |> post("/api/v1/statuses", %{ - "status" => "https://example.com/twitter-card", - "preview" => true - }) - - assert %{"card" => %{"title" => "The Rock"}} = json_response_and_validate_schema(conn1, 200) - - assert %{"card" => %{"title" => "Small Island Developing States Photo Submission"}} = - json_response_and_validate_schema(conn2, 200) - end - test "posting a status with OGP link preview", %{conn: conn} do Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end) |