added tests for post sets

This commit is contained in:
albert
2011-06-11 17:05:46 -04:00
parent ca7afc10be
commit 1a303fd3db
7 changed files with 202 additions and 23 deletions

View File

@@ -21,6 +21,17 @@ module PostSets
offset == 0
end
def validate
super
validate_page
end
def validate_page
if page > 1_000
raise Error.new("You cannot explicitly specify the page after page 1000")
end
end
def page
@page ||= params[:page] ? params[:page].to_i : 1
end