@@ -56,7 +56,7 @@ def test_partial_index_coerced
56
56
57
57
t = Topic . create! ( title : "abc" )
58
58
t . author_name = "John"
59
- assert_queries ( 1 ) do
59
+ assert_queries_count ( 1 ) do
60
60
t . valid?
61
61
end
62
62
end
@@ -234,7 +234,7 @@ def test_update_date_time_attributes_with_default_timezone_local
234
234
coerce_tests! %r{an empty transaction does not raise if preventing writes}
235
235
test "an empty transaction does not raise if preventing writes coerced" do
236
236
ActiveRecord ::Base . while_preventing_writes do
237
- assert_queries ( 1 , ignore_none : true ) do
237
+ assert_queries_count ( 1 , ignore_none : true ) do
238
238
Bird . transaction do
239
239
ActiveRecord ::Base . lease_connection . materialize_transactions
240
240
end
@@ -490,8 +490,8 @@ def test_limit_with_offset_is_kept_coerced
490
490
coerce_tests! :test_distinct_count_all_with_custom_select_and_order
491
491
def test_distinct_count_all_with_custom_select_and_order_coerced
492
492
accounts = Account . distinct . select ( "credit_limit % 10 AS the_limit" ) . order ( Arel . sql ( "credit_limit % 10" ) )
493
- assert_queries ( 1 ) { assert_equal 3 , accounts . count ( :all ) }
494
- assert_queries ( 1 ) { assert_equal 3 , accounts . load . size }
493
+ assert_queries_count ( 1 ) { assert_equal 3 , accounts . count ( :all ) }
494
+ assert_queries_count ( 1 ) { assert_equal 3 , accounts . load . size }
495
495
end
496
496
497
497
# Leave it up to users to format selects/functions so HAVING works correctly.
@@ -1324,7 +1324,7 @@ def test_create_without_primary_key_no_extra_query_coerced
1324
1324
self . table_name = "dashboards"
1325
1325
end
1326
1326
klass . create! # warmup schema cache
1327
- assert_queries ( 2 , ignore_none : true ) { klass . create! }
1327
+ assert_queries_count ( 2 , ignore_none : true ) { klass . create! }
1328
1328
end
1329
1329
end
1330
1330
@@ -1354,7 +1354,7 @@ def test_query_cached_even_when_types_are_reset_coerced
1354
1354
Task . initialize_find_by_cache
1355
1355
Task . define_attribute_methods
1356
1356
1357
- assert_queries ( 1 , ignore_none : true ) do
1357
+ assert_queries_count ( 1 , ignore_none : true ) do
1358
1358
Task . find ( 1 )
1359
1359
end
1360
1360
@@ -1454,11 +1454,11 @@ def test_relations_dont_load_all_records_in_pretty_print_coerced
1454
1454
def test_empty_complex_chained_relations_coerced
1455
1455
posts = Post . select ( "comments_count" ) . where ( "id is not null" ) . group ( "author_id" , "id" ) . where ( "legacy_comments_count > 0" )
1456
1456
1457
- assert_queries ( 1 ) { assert_equal false , posts . empty? }
1457
+ assert_queries_count ( 1 ) { assert_equal false , posts . empty? }
1458
1458
assert_not_predicate posts , :loaded?
1459
1459
1460
1460
no_posts = posts . where ( title : "" )
1461
- assert_queries ( 1 ) { assert_equal true , no_posts . empty? }
1461
+ assert_queries_count ( 1 ) { assert_equal true , no_posts . empty? }
1462
1462
assert_not_predicate no_posts , :loaded?
1463
1463
end
1464
1464
@@ -2377,7 +2377,7 @@ class BasePreventWritesTest < ActiveRecord::TestCase
2377
2377
coerce_tests! %r{an empty transaction does not raise if preventing writes}
2378
2378
test "an empty transaction does not raise if preventing writes coerced" do
2379
2379
ActiveRecord ::Base . while_preventing_writes do
2380
- assert_queries ( 1 , ignore_none : true ) do
2380
+ assert_queries_count ( 1 , ignore_none : true ) do
2381
2381
Bird . transaction do
2382
2382
ActiveRecord ::Base . lease_connection . materialize_transactions
2383
2383
end
0 commit comments