From 7fefcdef3fa840778ef8d74d98bf434c4acb5c25 Mon Sep 17 00:00:00 2001 From: Todd Eichel Date: Fri, 27 May 2016 15:00:15 -0700 Subject: [PATCH] Specs for pagination. --- spec/jekyll_seo_tag_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/jekyll_seo_tag_spec.rb b/spec/jekyll_seo_tag_spec.rb index 7f74c5c..fe6bc2a 100644 --- a/spec/jekyll_seo_tag_spec.rb +++ b/spec/jekyll_seo_tag_spec.rb @@ -10,6 +10,7 @@ describe Jekyll::SeoTag do let(:output) { Liquid::Template.parse("{% #{tag} #{text} %}").render!(context, {}) } let(:json) { output.match(%r{}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(//) 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