summaryrefslogtreecommitdiff
path: root/spec/serializers/merge_request_widget_entity_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/serializers/merge_request_widget_entity_spec.rb')
-rw-r--r--spec/serializers/merge_request_widget_entity_spec.rb27
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