ignore time part for dates in validation

This commit is contained in:
Adam Meehan
2008-07-11 17:23:37 +10:00
parent eafce02a73
commit 20ed2b1633
2 changed files with 16 additions and 0 deletions

View File

@@ -146,6 +146,12 @@ describe ValidatesTimeliness::Validations do
end
describe "for date type" do
it "should validate with invalid time part" do
person = BasicValidation.new
person.birth_date = "1980-01-01 25:61:61"
person.should be_valid
end
describe "with before and after restrictions" do
before :all do
class DateBeforeAfter < Person
@@ -210,6 +216,12 @@ describe ValidatesTimeliness::Validations do
end
describe "for time type" do
it "should validate with invalid date part" do
person = BasicValidation.new
person.birth_time = "1980-02-30 23:59:59"
person.should be_valid
end
describe "with before and after restrictions" do
before :all do
class TimeBeforeAfter < Person