Updating import_test to be Ruby 1.9.2 compatible. Ruby 1.9.1 changed the Date.parse capabilities to no longer support MM/DD/YYYY functionality so we only test against YYYY/MM/DD.

[fixes https://github.com/zdennis/activerecord-import/issues/19]
master
Zach Dennis 2011-05-04 19:55:46 -04:00
parent e079e19a29
commit 5b3740e0f2
1 changed files with 1 additions and 6 deletions

View File

@ -234,14 +234,9 @@ describe "#import" do
end
context "importing a datetime field" do
it "should import a date with MM/DD/YYYY format just fine" do
Topic.import [:author_name, :title, :last_read], [["Bob Jones", "Topic 1", "05/14/2010"]]
assert_equal "05/14/2010".to_date, Topic.last.last_read.to_date
end
it "should import a date with YYYY/MM/DD format just fine" do
Topic.import [:author_name, :title, :last_read], [["Bob Jones", "Topic 2", "2010/05/14"]]
assert_equal "05/14/2010".to_date, Topic.last.last_read.to_date
assert_equal "2010/05/14".to_date, Topic.last.last_read.to_date
end
end
end