spec/formats_spec.rb in validates_timeliness-1.1.4 vs spec/formats_spec.rb in validates_timeliness-1.1.5
- old
+ new
@@ -155,12 +155,17 @@
it "should parse date string when type is datetime" do
time_array = formats.parse('2000-02-01', :datetime, false)
time_array.should == [2000,2,1,0,0,0,0]
end
-
+
it "should ignore time when extracting date and strict is false" do
time_array = formats.parse('2000-02-01 12:12', :date, false)
+ time_array.should == [2000,2,1,0,0,0,0]
+ end
+
+ it "should ignore time when extracting date from format with trailing year and strict is false" do
+ time_array = formats.parse('01-02-2000 12:12', :date, false)
time_array.should == [2000,2,1,0,0,0,0]
end
it "should ignore date when extracting time and strict is false" do
time_array = formats.parse('2000-02-01 12:12', :time, false)