Sha256: d4ef0c46ce8cf4f5cc4e5f0701b1162f65e6a36164e5f7a051fa5ac88062f595

Contents?: true

Size: 718 Bytes

Versions: 6

Compression:

Stored size: 718 Bytes

Contents

# frozen_string_literal: true

require "cases/helper"
require "models/computer"
require "models/developer"

class PreparedStatementsDisabledTest < ActiveRecord::PostgreSQLTestCase
  fixtures :developers

  def setup
    @conn = ActiveRecord::Base.establish_connection :arunit_without_prepared_statements
  end

  def teardown
    @conn.release_connection
    ActiveRecord::Base.establish_connection :arunit
  end

  def test_select_query_works_even_when_prepared_statements_are_disabled
    assert_not Developer.connection.prepared_statements

    david = developers(:david)

    assert_equal david, Developer.where(name: "David").last # With Binds
    assert_operator Developer.count, :>, 0 # Without Binds
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
ibm_db-5.5.0 test/cases/adapters/postgresql/prepared_statements_disabled_test.rb
ibm_db-5.4.1 test/cases/adapters/postgresql/prepared_statements_disabled_test.rb
ibm_db-5.4.0 test/cases/adapters/postgresql/prepared_statements_disabled_test.rb
ibm_db-5.3.2 test/cases/adapters/postgresql/prepared_statements_disabled_test.rb
ibm_db-5.3.1 test/cases/adapters/postgresql/prepared_statements_disabled_test.rb
ruby-on-quails-0.1.0 activerecord/test/cases/adapters/postgresql/prepared_statements_disabled_test.rb