diff --git a/lib/rspec/dunlop/matchers/exceed_query_limit.rb b/lib/rspec/dunlop/matchers/exceed_query_limit.rb index 4ed97cd..fc23ca2 100644 --- a/lib/rspec/dunlop/matchers/exceed_query_limit.rb +++ b/lib/rspec/dunlop/matchers/exceed_query_limit.rb @@ -17,6 +17,8 @@ module ActiveRecord count_query = true count_query = false if %w[ CACHE SCHEMA SAVEPOINT ].include?(values[:name]) or values[:sql]['SAVEPOINT'] count_query = false if %w[ BEGIN COMMIT ].include?(values[:sql]) + count_query = false if values[:sql].to_s.end_with?('subquery_for_count') # expect change blocks + count_query = false if values[:sql].to_s['1 AS one'] # expect change blocks if count_query @query_count += 1 @performed_queries << values[:sql]