diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/support/matchers/exceed_query_limit.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/support/matchers/exceed_query_limit.rb')
-rw-r--r-- | spec/support/matchers/exceed_query_limit.rb | 4 |
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 |