Commit f5d33bc1 authored by drew cimino's avatar drew cimino

Clarify some RSpec expectations

parent 5d3c1ceb
...@@ -102,6 +102,8 @@ RSpec.describe MergeRequestWidgetEntity do ...@@ -102,6 +102,8 @@ RSpec.describe MergeRequestWidgetEntity do
context 'with report artifacts' do context 'with report artifacts' do
let(:pipeline) { create(:ci_pipeline, :with_codequality_report, project: project) } let(:pipeline) { create(:ci_pipeline, :with_codequality_report, project: project) }
let(:generic_job_id) { pipeline.builds.first.id }
let(:merge_base_job_id) { merge_base_pipeline.builds.first.id }
it 'has head_path and base_path entries' do it 'has head_path and base_path entries' do
expect(subject[:codeclimate][:head_path]).to be_present expect(subject[:codeclimate][:head_path]).to be_present
...@@ -113,7 +115,8 @@ RSpec.describe MergeRequestWidgetEntity do ...@@ -113,7 +115,8 @@ RSpec.describe MergeRequestWidgetEntity do
context 'with merge_base_pipelines enabled' do context 'with merge_base_pipelines enabled' do
it 'returns URLs from the head_pipeline and merge_base_pipeline' do it 'returns URLs from the head_pipeline and merge_base_pipeline' do
expect(subject[:codeclimate][:head_path]).not_to eq(subject[:codeclimate][:base_path]) 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 end
...@@ -123,7 +126,8 @@ RSpec.describe MergeRequestWidgetEntity do ...@@ -123,7 +126,8 @@ RSpec.describe MergeRequestWidgetEntity do
end end
it 'returns URLs from the head_pipeline and base_pipeline' do it 'returns URLs from the head_pipeline and base_pipeline' do
expect(subject[:codeclimate][:head_path]).to eq(subject[:codeclimate][:base_path]) 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 end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment