diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-08-18 14:12:40 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-08-18 14:12:40 +0200 |
commit | 22f1b04637a22c44c4f3ae591d180f5335d3ae16 (patch) | |
tree | 3ec9ee7a819952a09e3db534a54be63dc2d78798 /spec | |
parent | accaf7eaf268b340b39b6ef9b949cc78988b0e33 (diff) | |
download | gitlab-ce-22f1b04637a22c44c4f3ae591d180f5335d3ae16.tar.gz |
Update merge request pipeline even if if has errors
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/ci/create_pipeline_service_spec.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb index bf68ee0e64d..8465a6f99bd 100644 --- a/spec/services/ci/create_pipeline_service_spec.rb +++ b/spec/services/ci/create_pipeline_service_spec.rb @@ -110,11 +110,29 @@ describe Ci::CreatePipelineService do allow_any_instance_of(Ci::Pipeline) .to receive(:latest?).and_return(false) - pipeline + execute_service expect(merge_request.reload.head_pipeline).to be_nil end end + + context 'when pipeline has errors' do + before do + stub_ci_pipeline_yaml_file('some invalid syntax') + end + + it 'updates merge request head pipeline reference' do + merge_request = create(:merge_request, source_branch: 'master', + target_branch: 'feature', + source_project: project) + + head_pipeline = execute_service + + expect(head_pipeline).to be_persisted + expect(head_pipeline.yaml_errors).to be_present + expect(merge_request.reload.head_pipeline).to eq head_pipeline + end + end end context 'auto-cancel enabled' do |