Permalink
Browse files

Fix `test_case_insensitiveness` to follow up eb5fef5

  • Loading branch information...
kamipo committed Jan 11, 2019
1 parent 6c6c324 commit fa7c717bb22f054189530eb65dcb34011e343499
Showing with 8 additions and 9 deletions.
  1. +8 −9 activerecord/test/cases/adapters/postgresql/case_insensitive_test.rb
@@ -7,22 +7,21 @@ 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
attr = Default.arel_attribute(:char1)
comparison = connection.case_insensitive_comparison(attr, nil)
assert_match(/lower/i, comparison.to_sql)

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

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

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

0 comments on commit fa7c717

Please sign in to comment.