diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-06-06 13:00:34 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-06-06 13:00:34 +0300 |
commit | 9984f07a28273035d6c989913cb76c9c371965d0 (patch) | |
tree | be761d3a2306c6a6b3bc174e41b8676b9b14759c /spec/services/ci | |
parent | d44305eba7fb739447a698e8df123f03dadca9d2 (diff) |
Disallow legacy trigger without a owner
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11910#note_31594492
https://gitlab.com/gitlab-org/gitlab-ce/issues/30634#note_31601001
Diffstat (limited to 'spec/services/ci')
-rw-r--r-- | spec/services/ci/create_pipeline_service_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb index 2616dcc6f04..b8534a9d1aa 100644 --- a/spec/services/ci/create_pipeline_service_spec.rb +++ b/spec/services/ci/create_pipeline_service_spec.rb @@ -409,5 +409,18 @@ describe Ci::CreatePipelineService, services: true do it_behaves_like 'when ref is protected' end + + context 'when ref is not protected' do + context 'when trigger belongs to no one' do + let(:user) {} + let(:trigger_request) { create(:ci_trigger_request) } + + it 'does not create a pipeline' do + expect(execute_service(trigger_request: trigger_request)) + .not_to be_persisted + expect(Ci::Pipeline.count).to eq(0) + end + end + end end end |