Web.MastodonAPI.MastodonAPIControllerTest: Add testing of the flavour switching
[akkoma] / test / web / mastodon_api / status_view_test.exs
index f0c4468cf04ecbcd737ee35cc1f02f10e9d31745..0dc9c538cb5b255cfa624e315feabda0c2a1db42 100644 (file)
@@ -5,7 +5,8 @@
 defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
   use Pleroma.DataCase
 
-  alias Pleroma.Web.MastodonAPI.{StatusView, AccountView}
+  alias Pleroma.Web.MastodonAPI.AccountView
+  alias Pleroma.Web.MastodonAPI.StatusView
   alias Pleroma.User
   alias Pleroma.Web.OStatus
   alias Pleroma.Web.CommonAPI
@@ -274,5 +275,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