diff options
Diffstat (limited to 'spec/models/ci/build_dependencies_spec.rb')
-rw-r--r-- | spec/models/ci/build_dependencies_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/ci/build_dependencies_spec.rb b/spec/models/ci/build_dependencies_spec.rb index 331ba9953ca..cd330324840 100644 --- a/spec/models/ci/build_dependencies_spec.rb +++ b/spec/models/ci/build_dependencies_spec.rb @@ -55,6 +55,24 @@ RSpec.describe Ci::BuildDependencies do end end end + + context 'when needs refer to jobs from the same stage' do + let(:job) do + create(:ci_build, + pipeline: pipeline, + name: 'dag_job', + scheduling_type: :dag, + stage_idx: 2, + stage: 'deploy' + ) + end + + before do + create(:ci_build_need, build: job, name: 'staging', artifacts: true) + end + + it { is_expected.to contain_exactly(staging) } + end end describe 'jobs from specified dependencies' do |