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:
parent
c9ace59662
commit
ce545120ed
1 changed files with 14 additions and 14 deletions
|
@ -248,7 +248,7 @@ describe 'Kaminari::ActionViewExtension' do
|
||||||
|
|
||||||
describe '#rel_next_prev_link_tags' do
|
describe '#rel_next_prev_link_tags' do
|
||||||
before do
|
before do
|
||||||
75.times {|i| User.create! :name => "user#{i}"}
|
80.times {|i| User.create! :name => "user#{i}"}
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'the first page' do
|
context 'the first page' do
|
||||||
|
@ -263,25 +263,25 @@ describe 'Kaminari::ActionViewExtension' do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'the middle page' do
|
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
|
before do
|
||||||
@users = User.page(3).per(25)
|
@users = User.page(3).per(25)
|
||||||
end
|
end
|
||||||
|
|
||||||
subject { helper.rel_next_prev_link_tags @users, :params => {:controller => 'users', :action => 'index'} }
|
subject { helper.rel_next_prev_link_tags @users, :params => {:controller => 'users', :action => 'index'} }
|
||||||
it { should match(/rel="prev"/) }
|
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"/) }
|
it { should_not match(/rel="next"/) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue