mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
Improve StatusView tests for Cards
This commit is contained in:
parent
818d9f7b63
commit
5e7f4f687e
1 changed files with 4 additions and 4 deletions
|
@ -738,7 +738,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
||||||
{:ok, card} =
|
{:ok, card} =
|
||||||
Card.create(page_url, %{image: page_url <> "/example.jpg", title: "Example website"})
|
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
|
end
|
||||||
|
|
||||||
test "a rich media card without a site name or image renders correctly" do
|
test "a rich media card without a site name or image renders correctly" do
|
||||||
|
@ -751,7 +751,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
||||||
|
|
||||||
{:ok, card} = Card.create(page_url, fields)
|
{: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
|
end
|
||||||
|
|
||||||
test "a rich media card without an image renders correctly" do
|
test "a rich media card without an image renders correctly" do
|
||||||
|
@ -765,7 +765,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
||||||
|
|
||||||
{:ok, card} = Card.create(page_url, fields)
|
{: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
|
end
|
||||||
|
|
||||||
test "a rich media card with all relevant data renders correctly" do
|
test "a rich media card with all relevant data renders correctly" do
|
||||||
|
@ -781,7 +781,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
||||||
|
|
||||||
{:ok, card} = Card.create(page_url, fields)
|
{: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
|
end
|
||||||
|
|
||||||
test "a rich media card has all media proxied" do
|
test "a rich media card has all media proxied" do
|
||||||
|
|
Loading…
Reference in a new issue