Specs for pagination.

This commit is contained in:
Todd Eichel 2016-05-27 15:00:15 -07:00
parent edd65c3f14
commit 7fefcdef3f
No known key found for this signature in database
GPG Key ID: F9BFFDFEC16FD5E9
1 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,7 @@ describe Jekyll::SeoTag do
let(:output) { Liquid::Template.parse("{% #{tag} #{text} %}").render!(context, {}) }
let(:json) { output.match(%r{<script type=\"application/ld\+json\">(.*)</script>}m)[1] }
let(:json_data) { JSON.parse(json) }
let(:paginator) { { 'previous_page' => true, 'previous_page_path' => 'foo', 'next_page' => true, 'next_page_path' => 'bar' } }
before do
Jekyll.logger.log_level = :error
@ -443,4 +444,13 @@ EOS
expect(output).not_to match(/<title>/)
end
end
context 'with pagination' do
let(:context) { make_context(environments: { 'paginator' => paginator }) }
it 'outputs pagination links' do
expect(output).to match(%r{<link rel="prev" href="foo">})
expect(output).to match(%r{<link rel="next" href="bar">})
end
end
end