Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
bd63089a
Verified
Commit
bd63089a
authored
Jun 15, 2020
by
minibikini
Browse files
Fix tests
parent
58e4e3db
Pipeline
#27241
passed with stages
in 16 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test/web/rich_media/parsers/twitter_card_test.exs
View file @
bd63089a
...
...
@@ -17,18 +17,18 @@ test "parses twitter card with only name attributes" do
assert
TwitterCard
.
parse
(
html
,
%{})
==
%{
"app:id:googleplay"
:
"com.nytimes.android"
,
"app:name:googleplay"
:
"NYTimes"
,
"app:url:googleplay"
:
"nytimes://reader/id/100000006583622"
,
site
:
nil
,
description
:
"app:id:googleplay"
=>
"com.nytimes.android"
,
"app:name:googleplay"
=>
"NYTimes"
,
"app:url:googleplay"
=>
"nytimes://reader/id/100000006583622"
,
"
site
"
=>
nil
,
"
description
"
=>
"With little oversight, the N.Y.P.D. has been using powerful surveillance technology on photos of children and teenagers."
,
image
:
"
image
"
=>
"https://static01.nyt.com/images/2019/08/01/nyregion/01nypd-juveniles-promo/01nypd-juveniles-promo-facebookJumbo.jpg"
,
type
:
"article"
,
url
:
"
type
"
=>
"article"
,
"
url
"
=>
"https://www.nytimes.com/2019/08/01/nyregion/nypd-facial-recognition-children-teenagers.html"
,
title
:
"
title
"
=>
"She Was Arrested at 14. Then Her Photo Went to a Facial Recognition Database."
}
end
...
...
@@ -40,17 +40,17 @@ test "parses twitter card with only property attributes" do
assert
TwitterCard
.
parse
(
html
,
%{})
==
%{
card
:
"summary_large_image"
,
description
:
"
card
"
=>
"summary_large_image"
,
"
description
"
=>
"With little oversight, the N.Y.P.D. has been using powerful surveillance technology on photos of children and teenagers."
,
image
:
"
image
"
=>
"https://static01.nyt.com/images/2019/08/01/nyregion/01nypd-juveniles-promo/01nypd-juveniles-promo-videoSixteenByNineJumbo1600.jpg"
,
"image:alt"
:
""
,
title
:
"image:alt"
=>
""
,
"
title
"
=>
"She Was Arrested at 14. Then Her Photo Went to a Facial Recognition Database."
,
url
:
"
url
"
=>
"https://www.nytimes.com/2019/08/01/nyregion/nypd-facial-recognition-children-teenagers.html"
,
type
:
"article"
"
type
"
=>
"article"
}
end
...
...
@@ -61,21 +61,21 @@ test "parses twitter card with name & property attributes" do
assert
TwitterCard
.
parse
(
html
,
%{})
==
%{
"app:id:googleplay"
:
"com.nytimes.android"
,
"app:name:googleplay"
:
"NYTimes"
,
"app:url:googleplay"
:
"nytimes://reader/id/100000006583622"
,
card
:
"summary_large_image"
,
description
:
"app:id:googleplay"
=>
"com.nytimes.android"
,
"app:name:googleplay"
=>
"NYTimes"
,
"app:url:googleplay"
=>
"nytimes://reader/id/100000006583622"
,
"
card
"
=>
"summary_large_image"
,
"
description
"
=>
"With little oversight, the N.Y.P.D. has been using powerful surveillance technology on photos of children and teenagers."
,
image
:
"
image
"
=>
"https://static01.nyt.com/images/2019/08/01/nyregion/01nypd-juveniles-promo/01nypd-juveniles-promo-videoSixteenByNineJumbo1600.jpg"
,
"image:alt"
:
""
,
site
:
nil
,
title
:
"image:alt"
=>
""
,
"
site
"
=>
nil
,
"
title
"
=>
"She Was Arrested at 14. Then Her Photo Went to a Facial Recognition Database."
,
url
:
"
url
"
=>
"https://www.nytimes.com/2019/08/01/nyregion/nypd-facial-recognition-children-teenagers.html"
,
type
:
"article"
"
type
"
=>
"article"
}
end
...
...
@@ -90,15 +90,15 @@ test "respect only first title tag on the page" do
assert
TwitterCard
.
parse
(
html
,
%{})
==
%{
site
:
"@atlasobscura"
,
title
:
"The Missing Grave of Margaret Corbin, Revolutionary War Veteran"
,
card
:
"summary_large_image"
,
image
:
image_path
,
description
:
"
site
"
=>
"@atlasobscura"
,
"
title
"
=>
"The Missing Grave of Margaret Corbin, Revolutionary War Veteran"
,
"
card
"
=>
"summary_large_image"
,
"
image
"
=>
image_path
,
"
description
"
=>
"She's the only woman veteran honored with a monument at West Point. But where was she buried?"
,
site_name
:
"Atlas Obscura"
,
type
:
"article"
,
url
:
"http://www.atlasobscura.com/articles/margaret-corbin-grave-west-point"
"
site_name
"
=>
"Atlas Obscura"
,
"
type
"
=>
"article"
,
"
url
"
=>
"http://www.atlasobscura.com/articles/margaret-corbin-grave-west-point"
}
end
...
...
@@ -109,18 +109,18 @@ test "takes first founded title in html head if there is html markup error" do
assert
TwitterCard
.
parse
(
html
,
%{})
==
%{
site
:
nil
,
title
:
"
site
"
=>
nil
,
"
title
"
=>
"She Was Arrested at 14. Then Her Photo Went to a Facial Recognition Database."
,
"app:id:googleplay"
:
"com.nytimes.android"
,
"app:name:googleplay"
:
"NYTimes"
,
"app:url:googleplay"
:
"nytimes://reader/id/100000006583622"
,
description
:
"app:id:googleplay"
=>
"com.nytimes.android"
,
"app:name:googleplay"
=>
"NYTimes"
,
"app:url:googleplay"
=>
"nytimes://reader/id/100000006583622"
,
"
description
"
=>
"With little oversight, the N.Y.P.D. has been using powerful surveillance technology on photos of children and teenagers."
,
image
:
"
image
"
=>
"https://static01.nyt.com/images/2019/08/01/nyregion/01nypd-juveniles-promo/01nypd-juveniles-promo-facebookJumbo.jpg"
,
type
:
"article"
,
url
:
"
type
"
=>
"article"
,
"
url
"
=>
"https://www.nytimes.com/2019/08/01/nyregion/nypd-facial-recognition-children-teenagers.html"
}
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment