aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_one_associations_test.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-10-05 03:07:12 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-10-05 04:11:13 +0900
commit811be477786455d144819a5e9fbb7f9f54b8da69 (patch)
tree95ccdab553e3a368f554c0276fc9af517d896a0f /activerecord/test/cases/associations/has_one_associations_test.rb
parent5c7c3fe0d7059ba62e14bf6ac4ddfbdcabd905a6 (diff)
downloadrails-811be477786455d144819a5e9fbb7f9f54b8da69.tar.gz
rails-811be477786455d144819a5e9fbb7f9f54b8da69.tar.bz2
rails-811be477786455d144819a5e9fbb7f9f54b8da69.zip
Use `assert_no_queries` not to ignore BEGIN/COMMIT queries
`test_update_does_not_run_sql_if_record_has_not_changed` would pass without #18501 since `assert_queries` ignores BEGIN/COMMIT unless `ignore_none: true` is given. Since #32647, empty BEGIN/COMMIT is ommited. So we no longer need to use `assert_queries(0)` to ignore BEGIN/COMMIT in the queries.
Diffstat (limited to 'activerecord/test/cases/associations/has_one_associations_test.rb')
-rw-r--r--activerecord/test/cases/associations/has_one_associations_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/associations/has_one_associations_test.rb b/activerecord/test/cases/associations/has_one_associations_test.rb
index 9eea34d2b9..634f0ca736 100644
--- a/activerecord/test/cases/associations/has_one_associations_test.rb
+++ b/activerecord/test/cases/associations/has_one_associations_test.rb
@@ -37,10 +37,10 @@ class HasOneAssociationsTest < ActiveRecord::TestCase
def test_has_one_cache_nils
firm = companies(:another_firm)
assert_queries(1) { assert_nil firm.account }
- assert_queries(0) { assert_nil firm.account }
+ assert_no_queries { assert_nil firm.account }
- firms = Firm.all.merge!(includes: :account).to_a
- assert_queries(0) { firms.each(&:account) }
+ firms = Firm.includes(:account).to_a
+ assert_no_queries { firms.each(&:account) }
end
def test_with_select