diff options
author | wycats <wycats@gmail.com> | 2010-05-09 02:06:05 +0300 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-05-09 02:37:52 +0300 |
commit | d916c62cfc7c59ab6411407a05b946d3dd7535e9 (patch) | |
tree | 653ac4017ea6af4520dd9e6f60d846e19d5e3074 /activerecord/test | |
parent | 636ffa1f089a51c98fce616191846eaba93d7b87 (diff) | |
download | rails-d916c62cfc7c59ab6411407a05b946d3dd7535e9.tar.gz rails-d916c62cfc7c59ab6411407a05b946d3dd7535e9.tar.bz2 rails-d916c62cfc7c59ab6411407a05b946d3dd7535e9.zip |
eliminate alias_method_chain from ActiveRecord
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/locking_test.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/activerecord/test/cases/locking_test.rb b/activerecord/test/cases/locking_test.rb index aa2d9527f9..66874cdad1 100644 --- a/activerecord/test/cases/locking_test.rb +++ b/activerecord/test/cases/locking_test.rb @@ -195,7 +195,7 @@ class OptimisticLockingTest < ActiveRecord::TestCase assert_raises(ActiveRecord::RecordNotFound) { Person.find(p1.id) } assert_raises(ActiveRecord::RecordNotFound) { LegacyThing.find(t.id) } end - + def test_quote_table_name ref = references(:michael_magician) ref.favourite = !ref.favourite @@ -206,8 +206,11 @@ class OptimisticLockingTest < ActiveRecord::TestCase # is nothing else being updated. def test_update_without_attributes_does_not_only_update_lock_version assert_nothing_raised do - p1 = Person.new(:first_name => 'anika') - p1.send(:update_with_lock, []) + p1 = Person.create!(:first_name => 'anika') + lock_version = p1.lock_version + p1.save + p1.reload + assert_equal lock_version, p1.lock_version end end |