tests: add a rich media card that contains all relevant fields
authorWilliam Pitcock <nenolod@dereferenced.org>
Wed, 6 Feb 2019 18:27:55 +0000 (18:27 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Wed, 6 Feb 2019 18:27:55 +0000 (18:27 +0000)
test/web/mastodon_api/status_view_test.exs

index f0c4468cf04ecbcd737ee35cc1f02f10e9d31745..2106253f2390efd4c435daf3d63908deefd880b2 100644 (file)
@@ -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