From fb75c891ac7fe7331a9a967a96c674ed35eabdcf Mon Sep 17 00:00:00 2001 From: Bogdan Gusiev Date: Sat, 31 Mar 2018 18:29:08 +0300 Subject: Optimize the code inside AR::QueryCache middleware --- activerecord/test/cases/query_cache_test.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/query_cache_test.rb b/activerecord/test/cases/query_cache_test.rb index d635a47c0e..07be046fb7 100644 --- a/activerecord/test/cases/query_cache_test.rb +++ b/activerecord/test/cases/query_cache_test.rb @@ -441,8 +441,9 @@ class QueryCacheTest < ActiveRecord::TestCase assert_not ActiveRecord::Base.connection_handler.active_connections? # sanity check middleware { - assert ActiveRecord::Base.connection.query_cache_enabled, "QueryCache did not get lazily enabled" + assert_predicate ActiveRecord::Base.connection, :query_cache_enabled }.call({}) + assert_not_predicate ActiveRecord::Base.connection, :query_cache_enabled end end -- cgit v1.2.3