diff options
Diffstat (limited to 'spec/lib/gitlab/ci/pipeline/seed/stage_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/pipeline/seed/stage_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/seed/stage_spec.rb b/spec/lib/gitlab/ci/pipeline/seed/stage_spec.rb index c06772a976e..00e8ebdb7dd 100644 --- a/spec/lib/gitlab/ci/pipeline/seed/stage_spec.rb +++ b/spec/lib/gitlab/ci/pipeline/seed/stage_spec.rb @@ -79,5 +79,15 @@ describe Gitlab::Ci::Pipeline::Seed::Stage do expect(pipeline.stages) .to all(satisfy { |stage| stage.project.present? }) end + + it 'can not be persisted without explicit pipeline assignment' do + stage = subject.to_resource + + pipeline.save! + + expect(stage).not_to be_persisted + expect(pipeline.reload.stages.count).to eq 0 + expect(pipeline.reload.builds.count).to eq 0 + end end end |