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:
authorDouwe Maan <douwe@gitlab.com>2018-07-27 16:51:04 +0300
committerDouwe Maan <douwe@gitlab.com>2018-07-27 16:51:04 +0300
commit5f84509c05c63130143a9d9ac0c69a00ea10cf4c (patch)
tree47e96dcad9296ffb3005a1b41527b5b735ab4409 /spec/controllers
parented81ee9ba2b5a0b68996ccb238bfa4c69a6df062 (diff)
parent7a233b37cd1281698107f1f3236b425bf4cc5ae7 (diff)
Merge branch 'stop-dynamic-routable-creation' into 'master'
Stop building Route rows on the fly See merge request gitlab-org/gitlab-ce!20313
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/projects/pipelines_controller_spec.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb
index 290fcd4f8e6..d89716b1b50 100644
--- a/spec/controllers/projects/pipelines_controller_spec.rb
+++ b/spec/controllers/projects/pipelines_controller_spec.rb
@@ -55,10 +55,8 @@ describe Projects::PipelinesController do
stub_feature_flags(ci_pipeline_persisted_stages: false)
end
- it 'returns JSON with serialized pipelines', :request_store do
- queries = ActiveRecord::QueryRecorder.new do
- get_pipelines_index_json
- end
+ it 'returns JSON with serialized pipelines' do
+ get_pipelines_index_json
expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('pipeline')
@@ -73,8 +71,14 @@ describe Projects::PipelinesController do
json_response.dig('pipelines', 0, 'details', 'stages').tap do |stages|
expect(stages.count).to eq 3
end
+ end
+
+ it 'does not execute N+1 queries' do
+ queries = ActiveRecord::QueryRecorder.new do
+ get_pipelines_index_json
+ end
- expect(queries.count).to be_within(5).of(30)
+ expect(queries.count).to be <= 36
end
end