2011-04-21 02:30:34 -04:00
|
|
|
require File.expand_path('../spec_helper', File.dirname(__FILE__))
|
|
|
|
|
|
|
|
describe Kaminari::Configuration do
|
|
|
|
subject { Kaminari.config }
|
|
|
|
describe 'default_per_page' do
|
|
|
|
context 'by default' do
|
|
|
|
its(:default_per_page) { should == 25 }
|
|
|
|
end
|
|
|
|
context 'configured via config block' do
|
|
|
|
before do
|
|
|
|
Kaminari.configure {|c| c.default_per_page = 17}
|
|
|
|
end
|
|
|
|
its(:default_per_page) { should == 17 }
|
|
|
|
after do
|
|
|
|
Kaminari.configure {|c| c.default_per_page = 25}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2011-04-21 02:49:45 -04:00
|
|
|
|
|
|
|
describe 'window' do
|
|
|
|
context 'by default' do
|
|
|
|
its(:window) { should == 4 }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'outer_window' do
|
|
|
|
context 'by default' do
|
|
|
|
its(:outer_window) { should == 0 }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'left' do
|
|
|
|
context 'by default' do
|
|
|
|
its(:left) { should == 0 }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'right' do
|
|
|
|
context 'by default' do
|
|
|
|
its(:right) { should == 0 }
|
|
|
|
end
|
|
|
|
end
|
2011-04-22 06:26:11 -04:00
|
|
|
|
|
|
|
describe 'param_name' do
|
|
|
|
context 'by default' do
|
|
|
|
its(:param_name) { should == :page }
|
|
|
|
end
|
|
|
|
end
|
2011-04-21 02:30:34 -04:00
|
|
|
end
|