diff options
Diffstat (limited to 'spec/services/git/branch_push_service_spec.rb')
-rw-r--r-- | spec/services/git/branch_push_service_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/services/git/branch_push_service_spec.rb b/spec/services/git/branch_push_service_spec.rb index d7357cf4d0b..acd14005c69 100644 --- a/spec/services/git/branch_push_service_spec.rb +++ b/spec/services/git/branch_push_service_spec.rb @@ -129,6 +129,21 @@ describe Git::BranchPushService, services: true do end end end + + context 'when .gitlab-ci.yml file is invalid' do + before do + stub_ci_pipeline_yaml_file('invalid yaml file') + end + + it 'persists an error pipeline' do + expect { subject }.to change { Ci::Pipeline.count } + + pipeline = Ci::Pipeline.last + expect(pipeline).to be_push + expect(pipeline).to be_failed + expect(pipeline).to be_config_error + end + end end describe "Updates merge requests" do |