Permalink
Browse files

add tests for ActiveRecord::Base#create

  • Loading branch information...
1 parent bd328f4 commit 2db91fb546a2eacef2f31f671b615eb8d2ea7037 @take take committed Feb 17, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 activerecord/test/cases/base_test.rb
@@ -319,6 +319,14 @@ def test_create_after_initialize_with_block
assert_equal(true, cb.frickinawesome)
end
+ def test_create_after_initialize_with_array_param
+ cbs = CustomBulb.create([{ name: 'Dude' }, { name: 'Bob' }])
+ assert_equal 'Dude', cbs[0].name
+ assert_equal 'Bob', cbs[1].name
+ assert cbs[0].frickinawesome
+ assert !cbs[1].frickinawesome
+ end
+
def test_first_or_create
parrot = Bird.first_or_create(:color => 'green', :name => 'parrot')
assert parrot.persisted?

0 comments on commit 2db91fb

Please sign in to comment.