diff options
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 |