Sha256: cbd3aba05b938f6939100554a2407124cef325f77396645d160b7107424f6ff5

Contents?: true

Size: 463 Bytes

Versions: 7

Compression:

Stored size: 463 Bytes

Contents

# frozen_string_literal: true

require "cases/helper"
require "models/person"

module ActiveRecord
  class CustomLockingTest < ActiveRecord::TestCase
    fixtures :people

    def test_custom_lock
      if current_adapter?(:Mysql2Adapter)
        assert_match "SHARE MODE", Person.lock("LOCK IN SHARE MODE").to_sql
        assert_sql(/LOCK IN SHARE MODE/) do
          Person.all.merge!(lock: "LOCK IN SHARE MODE").find(1)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
ibm_db-5.5.1 test/cases/custom_locking_test.rb
ibm_db-5.5.0 test/cases/custom_locking_test.rb
ibm_db-5.4.1 test/cases/custom_locking_test.rb
ibm_db-5.4.0 test/cases/custom_locking_test.rb
ibm_db-5.3.2 test/cases/custom_locking_test.rb
ibm_db-5.3.1 test/cases/custom_locking_test.rb
ruby-on-quails-0.1.0 activerecord/test/cases/custom_locking_test.rb