diff options
author | Takehiro Adachi <takehiro0740@gmail.com> | 2013-02-18 02:12:08 +0900 |
---|---|---|
committer | Takehiro Adachi <takehiro0740@gmail.com> | 2013-02-18 02:12:08 +0900 |
commit | 2db91fb546a2eacef2f31f671b615eb8d2ea7037 (patch) | |
tree | f2185aaae29f004443d94c5587468bbbd3736759 /activerecord | |
parent | bd328f4342074f3234046afb7d8a30bb573545e3 (diff) | |
download | rails-2db91fb546a2eacef2f31f671b615eb8d2ea7037.tar.gz rails-2db91fb546a2eacef2f31f671b615eb8d2ea7037.tar.bz2 rails-2db91fb546a2eacef2f31f671b615eb8d2ea7037.zip |
add tests for ActiveRecord::Base#create
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 4f46459ab3..286e0be105 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -319,6 +319,14 @@ class BasicsTest < ActiveRecord::TestCase 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? |