Add tests for large image Twitter card
This commit is contained in:
parent
2494901e64
commit
ad5add0540
|
@ -132,13 +132,12 @@
|
|||
{% endif %}
|
||||
|
||||
{% if site.twitter %}
|
||||
|
||||
{% if page.image %}
|
||||
{% if seo_page_image %}
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
{% else %}
|
||||
<meta name="twitter:card" content="summary" />
|
||||
{% endif %}
|
||||
|
||||
|
||||
<meta name="twitter:site" content="@{{ site.twitter.username | replace:"@","" }}" />
|
||||
|
||||
{% if seo_author_twitter %}
|
||||
|
|
|
@ -203,6 +203,9 @@ EOS
|
|||
let(:page) { make_page('author' => 'benbalter') }
|
||||
|
||||
it 'outputs twitter card meta' do
|
||||
expected = %r{<meta name="twitter:card" content="summary" />}
|
||||
expect(output).to match(expected)
|
||||
|
||||
expected = %r{<meta name="twitter:site" content="@jekyllrb" />}
|
||||
expect(output).to match(expected)
|
||||
|
||||
|
@ -241,6 +244,15 @@ EOS
|
|||
end
|
||||
end
|
||||
|
||||
context 'with page.image' do
|
||||
let(:page) { make_page('image' => '/img/foo.png') }
|
||||
|
||||
it 'outputs summary card with large image' do
|
||||
expected = %r{<meta name="twitter:card" content="summary_large_image" />}
|
||||
expect(output).to match(expected)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with page.author as a hash' do
|
||||
let(:page) { make_page('author' => { 'twitter' => '@test' }) }
|
||||
|
||||
|
|
Loading…
Reference in New Issue