diff --git a/lib/validates_timeliness/validate_timeliness_matcher.rb b/lib/validates_timeliness/validate_timeliness_matcher.rb index 5b33e55..1740582 100644 --- a/lib/validates_timeliness/validate_timeliness_matcher.rb +++ b/lib/validates_timeliness/validate_timeliness_matcher.rb @@ -16,9 +16,9 @@ module Spec def matches?(record) @record = record - valid = error_matching('2000-01-32', /#{options[:invalid_date_message]}/) && - error_matching('2000-01-01 25:00:00', /#{options[:invalid_date_message]}/) && - no_error_matching('2000-01-01 12:12:12', /#{options[:invalid_date_message]}/) + valid = error_matching('2000-01-32 00:00:00', /#{options[:invalid_datetime_message]}/) && + error_matching('2000-01-01 25:00:00', /#{options[:invalid_datetime_message]}/) && + no_error_matching('2000-01-01 00:00:00', /#{options[:invalid_datetime_message]}/) if valid && after = options[:after] valid = error_matching(after, /#{options[:after_message]}/) &&