summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/mastodon_api/views/status_view_test.exs17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/pleroma/web/mastodon_api/views/status_view_test.exs b/test/pleroma/web/mastodon_api/views/status_view_test.exs
index c1313eb1b..1c2d7f7fd 100644
--- a/test/pleroma/web/mastodon_api/views/status_view_test.exs
+++ b/test/pleroma/web/mastodon_api/views/status_view_test.exs
@@ -768,6 +768,23 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
assert match?(%{provider_name: "example.com"}, StatusView.render("card.json", card))
end
+ test "a rich media card without descriptions returns the fields with empty strings" do
+ page_url = "https://example.com"
+
+ fields = %{
+ "url" => page_url,
+ "site_name" => "Example site name",
+ "title" => "Example website"
+ }
+
+ {:ok, card} = Card.create(page_url, fields)
+
+ assert match?(
+ %{description: "", image_description: ""},
+ StatusView.render("card.json", card)
+ )
+ end
+
test "a rich media card with all relevant data renders correctly" do
page_url = "https://example.com"