Skip to content
Snippets Groups Projects
Commit bac143ea authored by Felipe Artur's avatar Felipe Artur
Browse files

use actual head pipeline on merge request presenter

parent 5cf3ff27
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -838,6 +838,14 @@ describe MergeRequest do
 
expect(subject.head_pipeline).to be_nil
end
context 'when the source project does not exist' do
it 'returns nil' do
allow(subject).to receive(:source_project).and_return(nil)
expect(subject.head_pipeline).to be_nil
end
end
end
 
describe '#actual_head_pipeline' do
Loading
Loading
@@ -855,6 +863,12 @@ describe MergeRequest do
expect(subject.actual_head_pipeline).to eq(subject.head_pipeline)
expect(subject.actual_head_pipeline).to eq(pipeline)
end
it 'returns nil when source project does not exist' do
allow(subject).to receive(:source_project).and_return(nil)
expect(subject.actual_head_pipeline).to be_nil
end
end
end
 
Loading
Loading
Loading
Loading
@@ -31,7 +31,7 @@ describe MergeRequestPresenter do
let(:pipeline) { build_stubbed(:ci_pipeline) }
 
before do
allow(resource).to receive(:head_pipeline).and_return(pipeline)
allow(resource).to receive(:actual_head_pipeline).and_return(pipeline)
end
 
context 'success with warnings' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment