From 26670b09a7a1fb144a8a2b0141d64c0d85cd6ad6 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Wed, 6 Feb 2019 18:27:55 +0000 Subject: [PATCH] tests: add a rich media card that contains all relevant fields --- test/web/mastodon_api/status_view_test.exs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs index f0c4468cf..2106253f2 100644 --- a/test/web/mastodon_api/status_view_test.exs +++ b/test/web/mastodon_api/status_view_test.exs @@ -274,5 +274,20 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do %{provider_name: "Example site name"} = StatusView.render("card.json", %{page_url: page_url, rich_media: card}) end + + test "a rich media card with all relevant data renders correctly" do + page_url = "http://example.com" + + card = %{ + url: page_url, + site_name: "Example site name", + title: "Example website", + image: page_url <> "/example.jpg", + description: "Example description" + } + + %{provider_name: "Example site name"} = + StatusView.render("card.json", %{page_url: page_url, rich_media: card}) + end end end