summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-06-08 21:30:36 +0000
committerDouwe Maan <douwe@gitlab.com>2017-06-08 21:30:36 +0000
commitedd8d91194ce79cb5d77973c40436b98eb4d97fc (patch)
treed9191af968153418b96832bc67aa76cad39adfec
parentb670f21c9b75b8a5209a8b223602c826d66aacc7 (diff)
parentc3d5faa0ee1ed4df484eb9f494e008e08ced8b52 (diff)
downloadgitlab-ce-edd8d91194ce79cb5d77973c40436b98eb4d97fc.tar.gz
Merge branch 'use-request-store-on-mr-controller-query-count-spec' into 'master'
Use RequestStore on MR show.json query count spec See merge request !12024
-rw-r--r--spec/controllers/projects/merge_requests_controller_spec.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb
index 08024a2148b..0a64fe2beda 100644
--- a/spec/controllers/projects/merge_requests_controller_spec.rb
+++ b/spec/controllers/projects/merge_requests_controller_spec.rb
@@ -121,13 +121,18 @@ describe Projects::MergeRequestsController do
context 'number of queries' do
it 'verifies number of queries' do
+ RequestStore.begin!
+
# pre-create objects
merge_request
recorded = ActiveRecord::QueryRecorder.new { go(format: :json) }
- expect(recorded.count).to be_within(5).of(50)
+ expect(recorded.count).to be_within(5).of(30)
expect(recorded.cached_count).to eq(0)
+
+ RequestStore.end!
+ RequestStore.clear!
end
end
end