mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
format
This commit is contained in:
parent
cc914952ea
commit
9d0eebe38e
4 changed files with 8 additions and 10 deletions
|
@ -53,7 +53,7 @@ describe Kaminari::Configuration do
|
|||
|
||||
its(:param_name) { should == :test }
|
||||
|
||||
after do
|
||||
after do
|
||||
Kaminari.configure {|c| c.param_name = :page }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -18,4 +18,3 @@ describe 'Kaminari::ActionViewExtension' do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -23,6 +23,6 @@ describe Kaminari::ActiveRecordRelationMethods do
|
|||
# Only @author and @author2 have books titled with the title00x partern
|
||||
User.includes(:books_authored).where("books.title LIKE 'title00%'").page(1).total_count.should == 2
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -33,7 +33,7 @@ describe Kaminari::MongoMapperExtension do
|
|||
its(:num_pages) { should == 12 }
|
||||
it { should skip 25 }
|
||||
end
|
||||
|
||||
|
||||
context 'page "foobar"' do
|
||||
subject { Developer.page 'foobar' }
|
||||
it { should be_a Plucky::Query }
|
||||
|
@ -42,31 +42,30 @@ describe Kaminari::MongoMapperExtension do
|
|||
its(:num_pages) { should == 12 }
|
||||
it { should skip 0 }
|
||||
end
|
||||
|
||||
|
||||
context 'with criteria before' do
|
||||
it "should have the proper criteria source" do
|
||||
Developer.where(:salary => 1).page(2).criteria.source.should == {:salary => 1}
|
||||
end
|
||||
|
||||
|
||||
subject { Developer.where(:salary => 1).page 2 }
|
||||
its(:current_page) { should == 2 }
|
||||
its(:limit_value) { should == 25 }
|
||||
its(:num_pages) { should == 12 }
|
||||
it { should skip 25 }
|
||||
end
|
||||
|
||||
|
||||
context 'with criteria after' do
|
||||
it "should have the proper criteria source" do
|
||||
Developer.where(:salary => 1).page(2).criteria.source.should == {:salary => 1}
|
||||
end
|
||||
|
||||
|
||||
subject { Developer.page(2).where(:salary => 1) }
|
||||
its(:current_page) { should == 2 }
|
||||
its(:limit_value) { should == 25 }
|
||||
its(:num_pages) { should == 12 }
|
||||
it { should skip 25 }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe '#per' do
|
||||
|
@ -77,4 +76,4 @@ describe Kaminari::MongoMapperExtension do
|
|||
its(:num_pages) { should == 30 }
|
||||
it { should skip 10 }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue