Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (34 sloc) 0.784 kb
require 'spec_helper'
require 'will_paginate/per_page'
describe WillPaginate::PerPage do
class MyModel
extend WillPaginate::PerPage
end
it "has the default value" do
MyModel.per_page.should == 30
WillPaginate.per_page = 10
begin
MyModel.per_page.should == 10
ensure
WillPaginate.per_page = 30
end
end
it "casts values to int" do
WillPaginate.per_page = '10'
begin
MyModel.per_page.should == 10
ensure
WillPaginate.per_page = 30
end
end
it "has an explicit value" do
MyModel.per_page = 12
begin
MyModel.per_page.should == 12
subclass = Class.new(MyModel)
subclass.per_page.should == 12
ensure
MyModel.send(:remove_instance_variable, '@per_page')
end
end
end
Jump to Line
Something went wrong with that request. Please try again.