summaryrefslogtreecommitdiff
path: root/test/pleroma/web/metadata/providers/twitter_card_test.exs
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2021-08-08 14:37:15 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2021-08-08 14:37:15 +0000
commitdc63aaf84f07a6f8042f43617d8ec356fed85cec (patch)
tree5d12a05bce5dc1a23736fd37e7ca8c64580acd34 /test/pleroma/web/metadata/providers/twitter_card_test.exs
parentb221d77a6da07c684bdbc63ddf4500e0d7ffeae8 (diff)
parent0910777d41f8b4b3096c35c5fc97fc357e5d8c8c (diff)
Merge branch 'release/2.4.0' into 'stable'v2.4.0
Release/2.4.0 See merge request pleroma/pleroma!3493
Diffstat (limited to 'test/pleroma/web/metadata/providers/twitter_card_test.exs')
-rw-r--r--test/pleroma/web/metadata/providers/twitter_card_test.exs37
1 files changed, 29 insertions, 8 deletions
diff --git a/test/pleroma/web/metadata/providers/twitter_card_test.exs b/test/pleroma/web/metadata/providers/twitter_card_test.exs
index a35e44356..1b8d27cda 100644
--- a/test/pleroma/web/metadata/providers/twitter_card_test.exs
+++ b/test/pleroma/web/metadata/providers/twitter_card_test.exs
@@ -9,6 +9,7 @@ defmodule Pleroma.Web.Metadata.Providers.TwitterCardTest do
alias Pleroma.User
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.Endpoint
+ alias Pleroma.Web.MediaProxy
alias Pleroma.Web.Metadata.Providers.TwitterCard
alias Pleroma.Web.Metadata.Utils
alias Pleroma.Web.Router
@@ -17,7 +18,7 @@ defmodule Pleroma.Web.Metadata.Providers.TwitterCardTest do
test "it renders twitter card for user info" do
user = insert(:user, name: "Jimmy Hendriks", bio: "born 19 March 1994")
- avatar_url = Utils.attachment_url(User.avatar_url(user))
+ avatar_url = MediaProxy.preview_url(User.avatar_url(user))
res = TwitterCard.build_tags(%{user: user})
assert res == [
@@ -46,7 +47,7 @@ defmodule Pleroma.Web.Metadata.Providers.TwitterCardTest do
assert [
{:meta, [property: "twitter:title", content: Utils.user_name_string(user)], []},
- {:meta, [property: "twitter:description", content: "“pleroma in a nutshell”"], []},
+ {:meta, [property: "twitter:description", content: "pleroma in a nutshell"], []},
{:meta, [property: "twitter:image", content: "http://localhost:4001/images/avi.png"],
[]},
{:meta, [property: "twitter:card", content: "summary"], []}
@@ -91,7 +92,7 @@ defmodule Pleroma.Web.Metadata.Providers.TwitterCardTest do
assert [
{:meta, [property: "twitter:title", content: Utils.user_name_string(user)], []},
- {:meta, [property: "twitter:description", content: "“pleroma in a nutshell”"], []},
+ {:meta, [property: "twitter:description", content: "pleroma in a nutshell"], []},
{:meta, [property: "twitter:image", content: "http://localhost:4001/images/avi.png"],
[]},
{:meta, [property: "twitter:card", content: "summary"], []}
@@ -111,7 +112,14 @@ defmodule Pleroma.Web.Metadata.Providers.TwitterCardTest do
"content" => "pleroma in a nutshell",
"attachment" => [
%{
- "url" => [%{"mediaType" => "image/png", "href" => "https://pleroma.gov/tenshi.png"}]
+ "url" => [
+ %{
+ "mediaType" => "image/png",
+ "href" => "https://pleroma.gov/tenshi.png",
+ "height" => 1024,
+ "width" => 1280
+ }
+ ]
},
%{
"url" => [
@@ -123,7 +131,12 @@ defmodule Pleroma.Web.Metadata.Providers.TwitterCardTest do
},
%{
"url" => [
- %{"mediaType" => "video/webm", "href" => "https://pleroma.gov/about/juche.webm"}
+ %{
+ "mediaType" => "video/webm",
+ "href" => "https://pleroma.gov/about/juche.webm",
+ "height" => 600,
+ "width" => 800
+ }
]
}
]
@@ -134,17 +147,25 @@ defmodule Pleroma.Web.Metadata.Providers.TwitterCardTest do
assert [
{:meta, [property: "twitter:title", content: Utils.user_name_string(user)], []},
- {:meta, [property: "twitter:description", content: "“pleroma in a nutshell”"], []},
+ {:meta, [property: "twitter:description", content: "pleroma in a nutshell"], []},
{:meta, [property: "twitter:card", content: "summary_large_image"], []},
{:meta, [property: "twitter:player", content: "https://pleroma.gov/tenshi.png"], []},
+ {:meta, [property: "twitter:player:width", content: "1280"], []},
+ {:meta, [property: "twitter:player:height", content: "1024"], []},
{:meta, [property: "twitter:card", content: "player"], []},
{:meta,
[
property: "twitter:player",
content: Router.Helpers.o_status_url(Endpoint, :notice_player, activity.id)
], []},
- {:meta, [property: "twitter:player:width", content: "480"], []},
- {:meta, [property: "twitter:player:height", content: "480"], []}
+ {:meta, [property: "twitter:player:width", content: "800"], []},
+ {:meta, [property: "twitter:player:height", content: "600"], []},
+ {:meta,
+ [
+ property: "twitter:player:stream",
+ content: "https://pleroma.gov/about/juche.webm"
+ ], []},
+ {:meta, [property: "twitter:player:stream:content_type", content: "video/webm"], []}
] == result
end
end