diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-10 12:08:59 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-10 12:08:59 +0000 |
commit | 7351a484d79236b7e9d47c86f2fcc970b7ae10b0 (patch) | |
tree | 651b5fca7ea0460e3ce7c687cfa9e3a3b37eefc8 /spec/controllers/projects | |
parent | b4ded0ba7b4d2cdbed5b1f331cf2083a25ee4d7c (diff) | |
download | gitlab-ce-7351a484d79236b7e9d47c86f2fcc970b7ae10b0.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/projects')
-rw-r--r-- | spec/controllers/projects/pipelines_controller_spec.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb index d464827d63a..b12af198986 100644 --- a/spec/controllers/projects/pipelines_controller_spec.rb +++ b/spec/controllers/projects/pipelines_controller_spec.rb @@ -29,7 +29,7 @@ describe Projects::PipelinesController do stub_feature_flags(ci_pipeline_persisted_stages: true) end - it 'returns serialized pipelines', :request_store do + it 'returns serialized pipelines' do expect(::Gitlab::GitalyClient).to receive(:allow_ref_name_caching).and_call_original get_pipelines_index_json @@ -60,7 +60,6 @@ describe Projects::PipelinesController do # There appears to be one extra query for Pipelines#has_warnings? for some reason expect { get_pipelines_index_json }.not_to exceed_query_limit(control_count + 1) - expect(response).to have_gitlab_http_status(:ok) expect(json_response['pipelines'].count).to eq 10 end @@ -90,11 +89,18 @@ describe Projects::PipelinesController do end it 'does not execute N+1 queries' do - queries = ActiveRecord::QueryRecorder.new do + get_pipelines_index_json + + control_count = ActiveRecord::QueryRecorder.new do get_pipelines_index_json - end + end.count - expect(queries.count).to be <= 36 + create_all_pipeline_types + + # There appears to be one extra query for Pipelines#has_warnings? for some reason + expect { get_pipelines_index_json }.not_to exceed_query_limit(control_count + 1) + expect(response).to have_gitlab_http_status(:ok) + expect(json_response['pipelines'].count).to eq 10 end end |