You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fail to detect errors when invalid strings are provided #48
I found two situations where it fails to find errors, and I created two test cases to exhibit the problem:
it"complains when an invalid date is provided"doI18n.backend.reload!TestRecord.validates:expiration_date,date: truemodel=TestRecord.new("not a date")model.valid?.must_equalfalsemodel.errors[:expiration_date].must_equal(["is not a date"])end
it"complains when an invalid date is provided and option values evaluates to a negative value"doI18n.backend.reload!TestRecord.validates:expiration_date,date: {before: 50.years.ago}model=TestRecord.new("not a date")model.valid?.must_equalfalsemodel.errors[:expiration_date].must_equal(["is not a date"])end
Activity
Skulli commentedon Aug 11, 2014
Got the same issues now. Wrong dates as strings like "10.100.2014" are not recognized.
Possible dirty fix could be a validator like this
Mark non Date/Time objects as invalid