|
|
|
@ -192,6 +192,35 @@ RSpec.describe LinkDetailsExtractor do
|
|
|
|
|
|
|
|
|
|
include_examples 'structured data'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
context 'with author names as array' 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', 'Author 2'],
|
|
|
|
|
},
|
|
|
|
|
}.to_json
|
|
|
|
|
end
|
|
|
|
|
let(:html) { <<~HTML }
|
|
|
|
|
<!doctype html>
|
|
|
|
|
<html>
|
|
|
|
|
<body>
|
|
|
|
|
<script type="application/ld+json">
|
|
|
|
|
#{ld_json}
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
HTML
|
|
|
|
|
|
|
|
|
|
it 'joins author names' do
|
|
|
|
|
expect(subject.author_name).to eq 'Author 1, Author 2'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
context 'when Open Graph protocol data is present' do
|
|
|
|
|