@@ -130,14 +130,14 @@ class Dog ; end
130130 context 'Not Postgres' do
131131 should 'return options for where' do
132132 mock ( self ) . postgres? ( @model ) { false }
133- assert_equal [ "LOWER(table_name.method) LIKE ? " , "query%" ] , get_autocomplete_where_clause ( @model , @term , @method , @options )
133+ assert_equal [ "LOWER(table_name.method) LIKE LOWER(?) " , "query%" ] , get_autocomplete_where_clause ( @model , @term , @method , @options )
134134 end
135135 end
136136
137137 context 'Postgres' do
138138 should 'return options for where with ILIKE' do
139139 mock ( self ) . postgres? ( @model ) { true }
140- assert_equal [ "LOWER(table_name.method) ILIKE ? " , "query%" ] , get_autocomplete_where_clause ( @model , @term , @method , @options )
140+ assert_equal [ "LOWER(table_name.method) ILIKE LOWER(?) " , "query%" ] , get_autocomplete_where_clause ( @model , @term , @method , @options )
141141 end
142142 end
143143
@@ -146,15 +146,15 @@ class Dog ; end
146146 mock ( self ) . postgres? ( @model ) { true }
147147 @options [ :hstore ] = { method : :hsmethod , key : :hskey }
148148 @method = :hsmethod
149- assert_equal [ "LOWER(table_name.hsmethod -> 'hskey') LIKE ? " , "query%" ] , get_autocomplete_where_clause ( @model , @term , @method , @options )
149+ assert_equal [ "LOWER(table_name.hsmethod -> 'hskey') LIKE LOWER(?) " , "query%" ] , get_autocomplete_where_clause ( @model , @term , @method , @options )
150150 end
151151 end
152152
153153 context 'full search' do
154154 should 'return options for where with the term sourrounded by %%' do
155155 mock ( self ) . postgres? ( @model ) { false }
156156 @options [ :full ] = true
157- assert_equal [ "LOWER(table_name.method) LIKE ? " , "%query%" ] , get_autocomplete_where_clause ( @model , @term , @method , @options )
157+ assert_equal [ "LOWER(table_name.method) LIKE LOWER(?) " , "%query%" ] , get_autocomplete_where_clause ( @model , @term , @method , @options )
158158 end
159159 end
160160 end
0 commit comments