Merge commit '3178acc5cb8415a72b646dbe77be05255d3966f3' into glitch-soc/merge-upstream

This commit is contained in:
Claire committed 2025-01-23 13:38:23 +01:00
commit 19fa4cfcf2
143 files changed
+741 -1289

No files matched your search

+38
View File
@@ -249,6 +249,44 @@ RSpec.describe LinkDetailsExtractor do
expect(subject.author_name).to eq 'Author 1, Author 2'
end
end
context 'with embedded arrays' do
let(:ld_json) do
{
'@context' => 'https://schema.org',
'@type' => 'NewsArticle',
'headline' => 'A lot of authors',
'description' => 'But we decided to cram them into one',
'author' => [[{
'@type' => 'Person',
'name' => ['Author 1'],
}]],
'publisher' => [[{
'@type' => 'NewsMediaOrganization',
'name' => 'Pet News',
'url' => 'https://example.com',
}]],
}.to_json
end
let(:html) { <<~HTML }
<!doctype html>
<html>
<body>
<script type="application/ld+json">
#{ld_json}
</script>
</body>
</html>
HTML
it 'gives correct author_name' do
expect(subject.author_name).to eq 'Author 1'
end
it 'gives provider_name' do
expect(subject.provider_name).to eq 'Pet News'
end
end
end
context 'when Open Graph protocol data is present' do