diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/serializers/merge_request_widget_entity_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/serializers/merge_request_widget_entity_spec.rb')
-rw-r--r-- | spec/serializers/merge_request_widget_entity_spec.rb | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/spec/serializers/merge_request_widget_entity_spec.rb b/spec/serializers/merge_request_widget_entity_spec.rb index 5cad35eaedf..3f7d5542ae8 100644 --- a/spec/serializers/merge_request_widget_entity_spec.rb +++ b/spec/serializers/merge_request_widget_entity_spec.rb @@ -106,29 +106,16 @@ RSpec.describe MergeRequestWidgetEntity do let(:merge_base_job_id) { merge_base_pipeline.builds.first.id } it 'has head_path and base_path entries' do - expect(subject[:codeclimate][:head_path]).to be_present - expect(subject[:codeclimate][:base_path]).to be_present + expect(subject[:codeclimate][:head_path]).to include("/jobs/#{generic_job_id}/artifacts/download?file_type=codequality") + expect(subject[:codeclimate][:base_path]).to include("/jobs/#{generic_job_id}/artifacts/download?file_type=codequality") end context 'on pipelines for merged results' do let(:pipeline) { create(:ci_pipeline, :merged_result_pipeline, :with_codequality_report, project: project) } - context 'with merge_base_pipelines enabled' do - it 'returns URLs from the head_pipeline and merge_base_pipeline' do - expect(subject[:codeclimate][:head_path]).to include("/jobs/#{generic_job_id}/artifacts/download?file_type=codequality") - expect(subject[:codeclimate][:base_path]).to include("/jobs/#{merge_base_job_id}/artifacts/download?file_type=codequality") - end - end - - context 'with merge_base_pipelines disabled' do - before do - stub_feature_flags(merge_base_pipelines: false) - end - - it 'returns URLs from the head_pipeline and base_pipeline' do - expect(subject[:codeclimate][:head_path]).to include("/jobs/#{generic_job_id}/artifacts/download?file_type=codequality") - expect(subject[:codeclimate][:base_path]).to include("/jobs/#{generic_job_id}/artifacts/download?file_type=codequality") - end + it 'returns URLs from the head_pipeline and merge_base_pipeline' do + expect(subject[:codeclimate][:head_path]).to include("/jobs/#{generic_job_id}/artifacts/download?file_type=codequality") + expect(subject[:codeclimate][:base_path]).to include("/jobs/#{merge_base_job_id}/artifacts/download?file_type=codequality") end end end @@ -333,6 +320,10 @@ RSpec.describe MergeRequestWidgetEntity do end context 'when suggest pipeline feature is not enabled' do + before do + stub_feature_flags(suggest_pipeline: false) + end + it 'provides no valid value for user callout path' do expect(subject[:user_callouts_path]).to be_nil end |