summaryrefslogtreecommitdiff
path: root/spec/support/matchers/exceed_query_limit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/matchers/exceed_query_limit.rb')
-rw-r--r--spec/support/matchers/exceed_query_limit.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/support/matchers/exceed_query_limit.rb b/spec/support/matchers/exceed_query_limit.rb
index cc0abfa0dd6..04482d3bfb8 100644
--- a/spec/support/matchers/exceed_query_limit.rb
+++ b/spec/support/matchers/exceed_query_limit.rb
@@ -44,7 +44,7 @@ module ExceedQueryLimitHelpers
def log_message
if expected.is_a?(ActiveRecord::QueryRecorder)
counts = count_queries(strip_marginalia_annotations(expected.log))
- extra_queries = strip_marginalia_annotations(@recorder.log).reject { |query| counts[query] -= 1 unless counts[query].zero? }
+ extra_queries = strip_marginalia_annotations(@recorder.log).reject { |query| counts[query] -= 1 unless counts[query] == 0 }
extra_queries_display = count_queries(extra_queries).map { |query, count| "[#{count}] #{query}" }
(['Extra queries:'] + extra_queries_display).join("\n\n")
@@ -188,7 +188,7 @@ RSpec::Matchers.define :issue_same_number_of_queries_as do
def expected_count_message
or_fewer_msg = "or fewer" if @or_fewer
- threshold_msg = "(+/- #{threshold})" unless threshold.zero?
+ threshold_msg = "(+/- #{threshold})" unless threshold == 0
["#{expected_count}", or_fewer_msg, threshold_msg].compact.join(' ')
end