diff options
author | Gonçalo Silva <goncalossilva@gmail.com> | 2011-03-24 17:21:17 +0000 |
---|---|---|
committer | Gonçalo Silva <goncalossilva@gmail.com> | 2011-03-24 17:21:17 +0000 |
commit | 9887f238871bb2dd73de6ce8855615bcc5d8d079 (patch) | |
tree | 74fa9ff9524a51701cfa23f708b3f777c65b7fe5 /activerecord/test/cases/custom_locking_test.rb | |
parent | aff821508a16245ebc03510ba29c70379718dfb7 (diff) | |
parent | 5214e73850916de3c9127d35a4ecee0424d364a3 (diff) | |
download | rails-9887f238871bb2dd73de6ce8855615bcc5d8d079.tar.gz rails-9887f238871bb2dd73de6ce8855615bcc5d8d079.tar.bz2 rails-9887f238871bb2dd73de6ce8855615bcc5d8d079.zip |
Merge branch 'master' of https://github.com/rails/rails
Diffstat (limited to 'activerecord/test/cases/custom_locking_test.rb')
-rw-r--r-- | activerecord/test/cases/custom_locking_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/activerecord/test/cases/custom_locking_test.rb b/activerecord/test/cases/custom_locking_test.rb new file mode 100644 index 0000000000..d63ecdbcc5 --- /dev/null +++ b/activerecord/test/cases/custom_locking_test.rb @@ -0,0 +1,17 @@ +require "cases/helper" +require 'models/person' + +module ActiveRecord + class CustomLockingTest < ActiveRecord::TestCase + fixtures :people + + def test_custom_lock + if current_adapter?(:MysqlAdapter, :Mysql2Adapter) + assert_match 'SHARE MODE', Person.lock('LOCK IN SHARE MODE').to_sql + assert_sql(/LOCK IN SHARE MODE/) do + Person.find(1, :lock => 'LOCK IN SHARE MODE') + end + end + end + end +end |