From 5e7f4f687e55813059176d6046ac32c35e0e0738 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 8 May 2024 13:52:25 -0400 Subject: [PATCH] Improve StatusView tests for Cards --- test/pleroma/web/mastodon_api/views/status_view_test.exs | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 663610442a..c1313eb1be 100644 --- a/test/pleroma/web/mastodon_api/views/status_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/status_view_test.exs @@ -738,7 +738,7 @@ test "a rich media card without a site name renders correctly" do {:ok, card} = Card.create(page_url, %{image: page_url <> "/example.jpg", title: "Example website"}) - %{provider_name: "example.com"} = StatusView.render("card.json", card) + assert match?(%{provider_name: "example.com"}, StatusView.render("card.json", card)) end test "a rich media card without a site name or image renders correctly" do @@ -751,7 +751,7 @@ test "a rich media card without a site name or image renders correctly" do {:ok, card} = Card.create(page_url, fields) - %{provider_name: "example.com"} = StatusView.render("card.json", card) + assert match?(%{provider_name: "example.com"}, StatusView.render("card.json", card)) end test "a rich media card without an image renders correctly" do @@ -765,7 +765,7 @@ test "a rich media card without an image renders correctly" do {:ok, card} = Card.create(page_url, fields) - %{provider_name: "example.com"} = StatusView.render("card.json", card) + assert match?(%{provider_name: "example.com"}, StatusView.render("card.json", card)) end test "a rich media card with all relevant data renders correctly" do @@ -781,7 +781,7 @@ test "a rich media card with all relevant data renders correctly" do {:ok, card} = Card.create(page_url, fields) - %{provider_name: "example.com"} = StatusView.render("card.json", card) + assert match?(%{provider_name: "example.com"}, StatusView.render("card.json", card)) end test "a rich media card has all media proxied" do