Sha256: 15eb9f15a94072228422535a088d1f0aa915a51f977fcf2f3a8788504ed6373d

Contents?: true

Size: 1000 Bytes

Versions: 6

Compression:

Stored size: 1000 Bytes

Contents

require "cases/helper"

class PostgresqlCaseInsensitiveTest < ActiveRecord::PostgreSQLTestCase
  class Default < ActiveRecord::Base; end

  def test_case_insensitiveness
    connection = ActiveRecord::Base.connection
    table = Default.arel_table

    column = Default.columns_hash["char1"]
    comparison = connection.case_insensitive_comparison table, :char1, column, nil
    assert_match(/lower/i, comparison.to_sql)

    column = Default.columns_hash["char2"]
    comparison = connection.case_insensitive_comparison table, :char2, column, nil
    assert_match(/lower/i, comparison.to_sql)

    column = Default.columns_hash["char3"]
    comparison = connection.case_insensitive_comparison table, :char3, column, nil
    assert_match(/lower/i, comparison.to_sql)

    column = Default.columns_hash["multiline_default"]
    comparison = connection.case_insensitive_comparison table, :multiline_default, column, nil
    assert_match(/lower/i, comparison.to_sql)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ibm_db-5.2.0-x86-mingw32 test/cases/adapters/postgresql/case_insensitive_test.rb
ibm_db-5.1.0-x86-mingw32 test/cases/adapters/postgresql/case_insensitive_test.rb
ibm_db-5.0.5-x86-mingw32 test/cases/adapters/postgresql/case_insensitive_test.rb
ibm_db-5.0.4-x86-mingw32 test/cases/adapters/postgresql/case_insensitive_test.rb
ibm_db-5.0.3-x86-mingw32 test/cases/adapters/postgresql/case_insensitive_test.rb
ibm_db-5.0.2-x86-mingw32 test/cases/adapters/postgresql/case_insensitive_test.rb