Adding a test to ensure that specified ids are being saved when imported.

https://github.com/zdennis/activerecord-import/issues#issue/4
master
Zach Dennis 2011-03-19 15:19:50 -04:00
parent d901a7c60f
commit 32a2fe3bce
1 changed files with 7 additions and 1 deletions

View File

@ -142,6 +142,13 @@ describe "#import" do
end
end
context "with an array of columns and an array of values" do
it "should import ids when specified" do
Topic.import [:id, :author_name, :title], [[99, "Bob Jones", "Topic 99"]]
assert_equal 99, Topic.last.id
end
end
context "ActiveRecord timestamps" do
context "when the timestamps columns are present" do
setup do
@ -217,5 +224,4 @@ describe "#import" do
assert_equal "05/14/2010".to_date, Topic.last.last_read.to_date
end
end
end