1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

Tweak spec for sinatra again

This commit is contained in:
Yuki Nishijima 2014-01-31 19:30:25 -08:00
parent c9ace59662
commit ce545120ed

View file

@ -248,7 +248,7 @@ describe 'Kaminari::ActionViewExtension' do
describe '#rel_next_prev_link_tags' do
before do
75.times {|i| User.create! :name => "user#{i}"}
80.times {|i| User.create! :name => "user#{i}"}
end
context 'the first page' do
@ -263,25 +263,25 @@ describe 'Kaminari::ActionViewExtension' do
end
context 'the middle page' do
before do
@users = User.page(2).per(25)
end
subject { helper.rel_next_prev_link_tags @users, :params => {:controller => 'users', :action => 'index'} }
it { should match(/rel="prev"/) }
it { should match(/\?page=1/) }
it { should match(/rel="next"/) }
it { should match(/\?page=3/) }
end
context 'the last page' do
before do
@users = User.page(3).per(25)
end
subject { helper.rel_next_prev_link_tags @users, :params => {:controller => 'users', :action => 'index'} }
it { should match(/rel="prev"/) }
it { should match(/\?page=2"/) }
it { should match(/\?page=2/) }
it { should match(/rel="next"/) }
it { should match(/\?page=4/) }
end
context 'the last page' do
before do
@users = User.page(4).per(25)
end
subject { helper.rel_next_prev_link_tags @users, :params => {:controller => 'users', :action => 'index'} }
it { should match(/rel="prev"/) }
it { should match(/\?page=3"/) }
it { should_not match(/rel="next"/) }
end
end