BigW Consortium Gitlab

Commit ecd9c309 by Shinya Maeda

Add source policy spec

parent 32bfa48a
...@@ -123,6 +123,25 @@ module Ci ...@@ -123,6 +123,25 @@ module Ci
expect(seeds.first.builds.dig(0, :name)).to eq 'spinach' expect(seeds.first.builds.dig(0, :name)).to eq 'spinach'
end end
end end
context 'when source policy is specified' do
let(:config) do
YAML.dump(production: { stage: 'deploy', script: 'cap prod', only: ['triggers'] },
spinach: { stage: 'test', script: 'spinach', only: ['schedules'] })
end
let(:pipeline) do
create(:ci_empty_pipeline, source: :schedule)
end
it 'returns stage seeds only assigned to schedules' do
seeds = subject.stage_seeds(pipeline)
expect(seeds.size).to eq 1
expect(seeds.first.stage[:name]).to eq 'test'
expect(seeds.first.builds.dig(0, :name)).to eq 'spinach'
end
end
end end
describe "#builds_for_ref" do describe "#builds_for_ref" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment