File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,7 @@ def test_with_abstract_class_scope_should_be_executed_in_correct_context_coerced
270270require 'models/post'
271271require 'models/subscriber'
272272class EachTest < ActiveRecord ::TestCase
273+ # Quoting in tests does not cope with bracket quoting.
273274 coerce_tests! :test_find_in_batches_should_quote_batch_order
274275 def test_find_in_batches_should_quote_batch_order_coerced
275276 c = Post . connection
@@ -280,6 +281,18 @@ def test_find_in_batches_should_quote_batch_order_coerced
280281 end
281282 end
282283 end
284+
285+ # Quoting in tests does not cope with bracket quoting.
286+ coerce_tests! :test_in_batches_should_quote_batch_order
287+ def test_in_batches_should_quote_batch_order_coerced
288+ c = Post . connection
289+ assert_sql ( /ORDER BY \[ posts\] \. \[ id\] / ) do
290+ Post . in_batches ( of : 1 ) do |relation |
291+ assert_kind_of ActiveRecord ::Relation , relation
292+ assert_kind_of Post , relation . first
293+ end
294+ end
295+ end
283296end
284297
285298
You can’t perform that action at this time.
0 commit comments