added ignore_datetime_restriction_errors class option and docs

bit more for chronic parser
This commit is contained in:
Adam Meehan
2008-07-21 13:02:21 +10:00
parent 1836e4f6ca
commit 4e8007bc65
3 changed files with 54 additions and 13 deletions

View File

@@ -297,7 +297,6 @@ describe ValidatesTimeliness::Validations do
end
end
describe "with mixed value and restriction types" do
before :all do
class MixedBeforeAndAfter < Person
@@ -340,5 +339,23 @@ describe ValidatesTimeliness::Validations do
@person.errors.on(:birth_date).should match(/must be on or after/)
end
end
end
describe "ignoring rstriction errors" do
before :all do
class BadRestriction < Person
validates_date :birth_date, :before => Proc.new { raise }
self.ignore_datetime_restriction_errors = true
end
end
before :each do
@person = BadRestriction.new
end
it "should have no errors when restriction is invalid" do
@person.birth_date = '1950-01-01'
@person.should be_valid
end
end
end