summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2017-06-08 14:03:08 -0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2017-06-08 14:03:08 -0300
commitc3d5faa0ee1ed4df484eb9f494e008e08ced8b52 (patch)
tree23e8e0c58c876425734cd8bdbf7673ea4fac427f /spec/controllers
parente9002222a0fc65e4e3328c7c536e43516986eb40 (diff)
downloadgitlab-ce-c3d5faa0ee1ed4df484eb9f494e008e08ced8b52.tar.gz
Use RequestStore on MR show.json query count specuse-request-store-on-mr-controller-query-count-spec
Diffstat (limited to 'spec/controllers')
-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