diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-22 06:03:41 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-22 06:03:41 -0700 |
commit | ecd70039ba191371f3735d7a6336e4cfc6be83df (patch) | |
tree | 160eaa1cd6500ea61931851fb2918528af36f99e /activerecord/test/cases/locking_test.rb | |
parent | 49c8b671ecae204d7683ed7473acdaa15ac4aa63 (diff) | |
parent | 31a43ebc107fbd50e7e62567e5208a05909ec76c (diff) | |
download | rails-ecd70039ba191371f3735d7a6336e4cfc6be83df.tar.gz rails-ecd70039ba191371f3735d7a6336e4cfc6be83df.tar.bz2 rails-ecd70039ba191371f3735d7a6336e4cfc6be83df.zip |
Merge pull request #11528 from Empact/optimistic_lock_improvement
Rebase and make fixes to #6763 "Specified column type for quote_value"
Diffstat (limited to 'activerecord/test/cases/locking_test.rb')
-rw-r--r-- | activerecord/test/cases/locking_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/locking_test.rb b/activerecord/test/cases/locking_test.rb index db7d3b80ab..dfa12cb97c 100644 --- a/activerecord/test/cases/locking_test.rb +++ b/activerecord/test/cases/locking_test.rb @@ -28,6 +28,18 @@ end class OptimisticLockingTest < ActiveRecord::TestCase fixtures :people, :legacy_things, :references, :string_key_objects, :peoples_treasures + def test_quote_value_passed_lock_col + p1 = Person.find(1) + assert_equal 0, p1.lock_version + + Person.expects(:quote_value).with(0, Person.columns_hash[Person.locking_column]).returns('0').once + + p1.first_name = 'anika2' + p1.save! + + assert_equal 1, p1.lock_version + end + def test_non_integer_lock_existing s1 = StringKeyObject.find("record1") s2 = StringKeyObject.find("record1") |