Skip to content

Commit 827a2c6

Browse files
committed
add more spec on paginate tag
1 parent 02a7a9a commit 827a2c6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spec/lib/liquid-rails/tags/paginate_tag_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ module Rails
5252
end
5353
end
5454

55+
context 'second_page' do
56+
before(:all) { controller.params[:page] = 2 }
57+
58+
it '#previous' do
59+
expect_template_result("{% paginate post.comments by 2 %}{{ paginate.previous }}{% endpaginate %}", %|{"title"=>"« Previous", "url"=>"/?page=1", "is_link"=>true}|, { 'post' => @post_drop })
60+
end
61+
62+
it '#next' do
63+
expect_template_result("{% paginate post.comments by 2 %}{{ paginate.next }}{% endpaginate %}", %|{"title"=>"Next »", "url"=>"/?page=3", "is_link"=>true}|, { 'post' => @post_drop })
64+
end
65+
end
66+
5567
context 'last_page' do
5668
before(:all) { controller.params[:page] = 3 }
5769

0 commit comments

Comments
 (0)