Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-09-14 18:46:28 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2017-09-14 18:46:28 +0300
commit9c300fd98d05b32efac5d40e486462269414341f (patch)
treeebcc82a6ef38688211a14e5e925fb0c877bdacd9 /spec/requests
parent6dbd21abacadf055b75f02525c10477c84b74ee8 (diff)
Use the new query-recorder features as a PoC
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/projects_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 9602584f546..92e7d797cbd 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -54,9 +54,9 @@ describe API::Projects do
shared_examples_for 'projects response without N + 1 queries' do
it 'avoids N + 1 queries' do
- control_count = ActiveRecord::QueryRecorder.new do
+ control = ActiveRecord::QueryRecorder.new do
get api('/projects', current_user)
- end.count
+ end
if defined?(additional_project)
additional_project
@@ -66,7 +66,7 @@ describe API::Projects do
expect do
get api('/projects', current_user)
- end.not_to exceed_query_limit(control_count + 8)
+ end.not_to exceed_query_limit(control).with_threshold(8)
end
end