diff options
Diffstat (limited to 'activerecord/test/locking_test.rb')
-rw-r--r-- | activerecord/test/locking_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/locking_test.rb b/activerecord/test/locking_test.rb index bacc7b8ae0..1923ff590d 100644 --- a/activerecord/test/locking_test.rb +++ b/activerecord/test/locking_test.rb @@ -82,6 +82,18 @@ class PessimisticLockingTest < Test::Unit::TestCase end end + # Locking a record reloads it. + def test_sane_lock_method + assert_nothing_raised do + Person.transaction do + person = Person.find 1 + old, person.first_name = person.first_name, 'fooman' + person.lock! + assert_equal old, person.first_name + end + end + end + if current_adapter?(:PostgreSQLAdapter) def test_no_locks_no_wait first, second = duel { Person.find 1 } |