diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-09-15 11:30:15 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-11-19 19:07:43 -0300 |
commit | 6b0b95f1bd92e2ef35573cb59e8a14bd3ffb3777 (patch) | |
tree | 2becbc130de7ccf8ce230a79af128fa5088bcbe0 /activerecord | |
parent | f3adddb966f3c93de4992b42cf554e3ef2a3acf1 (diff) | |
download | rails-6b0b95f1bd92e2ef35573cb59e8a14bd3ffb3777.tar.gz rails-6b0b95f1bd92e2ef35573cb59e8a14bd3ffb3777.tar.bz2 rails-6b0b95f1bd92e2ef35573cb59e8a14bd3ffb3777.zip |
Add test for update_attributes and identity map.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/identity_map_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/activerecord/test/cases/identity_map_test.rb b/activerecord/test/cases/identity_map_test.rb index 1683bd28c3..7deda56541 100644 --- a/activerecord/test/cases/identity_map_test.rb +++ b/activerecord/test/cases/identity_map_test.rb @@ -274,4 +274,17 @@ class IdentityMapTest < ActiveRecord::TestCase assert_not_equal developer.salary, same_developer.salary end + def test_reload_object_if_update_attributes_fails + developer = Developer.first + developer.salary = 0 + + assert !developer.update_attributes(:salary => 0) + + same_developer = Developer.first + + assert_not_same developer, same_developer + assert_not_equal 0, same_developer.salary + assert_not_equal developer.salary, same_developer.salary + end + end |