diff options
author | Patrick Derichs <pderichs@gitlab.com> | 2019-07-24 14:30:19 +0200 |
---|---|---|
committer | Patrick Derichs <pderichs@gitlab.com> | 2019-07-26 08:14:50 +0200 |
commit | 2dfa469184427d49f32a07d559d23d2afac6879a (patch) | |
tree | 242e3582d6b0b374cbad198eaaaa678931fe0126 | |
parent | 6c68df0c2790d34c26220bbbfaf64d1721300794 (diff) | |
download | gitlab-ce-2dfa469184427d49f32a07d559d23d2afac6879a.tar.gz |
Changing to just counting NotesFinder queries
-rw-r--r-- | spec/controllers/concerns/issuable_notes_finder_query_count_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/controllers/concerns/issuable_notes_finder_query_count_spec.rb b/spec/controllers/concerns/issuable_notes_finder_query_count_spec.rb index 17836e8a48a..9f1b16582b6 100644 --- a/spec/controllers/concerns/issuable_notes_finder_query_count_spec.rb +++ b/spec/controllers/concerns/issuable_notes_finder_query_count_spec.rb @@ -64,12 +64,13 @@ describe 'Query counts for Issuable' do # New implementation discussions_provider = klass.new(issue, project, user) - new_count = ActiveRecord::QueryRecorder.new { discussions_provider.discussions }.count + # ActiveRecord::QueryRecorder.new { discussions_provider.discussions }.count + new_count = ActiveRecord::QueryRecorder.new { NotesFinder.new(project, user, {target_id: issue.id, target_type: 'issue', notes_filter: {}}).execute }.count # Activate former implementation klass.prepend(old_module) discussions_provider = klass.new(issue, project, user) - old_count = ActiveRecord::QueryRecorder.new { discussions_provider.discussions }.count + old_count = ActiveRecord::QueryRecorder.new { issue.discussion_notes }.count # puts "Old: #{old_count}" # puts "New: #{new_count}" |