debian-mirror-gitlab/spec/lib/gitlab/ci/templates/templates_spec.rb

35 lines
729 B
Ruby
Raw Normal View History

2018-12-05 23:21:45 +05:30
# frozen_string_literal: true
require 'spec_helper'
describe "CI YML Templates" do
2019-07-31 22:56:46 +05:30
using RSpec::Parameterized::TableSyntax
2019-07-07 11:18:12 +05:30
2019-07-31 22:56:46 +05:30
subject { Gitlab::Ci::YamlProcessor.new(content) }
where(:template_name) do
Gitlab::Template::GitlabCiYmlTemplate.all.map(&:full_name)
2019-07-07 11:18:12 +05:30
end
2019-07-31 22:56:46 +05:30
with_them do
let(:content) do
<<~EOS
include:
- template: #{template_name}
2019-07-07 11:18:12 +05:30
2019-07-31 22:56:46 +05:30
concrete_build_implemented_by_a_user:
stage: test
script: do something
EOS
end
it 'is valid' do
expect { subject }.not_to raise_error
2019-07-07 11:18:12 +05:30
end
2019-07-31 22:56:46 +05:30
it 'require default stages to be included' do
expect(subject.stages).to include(*Gitlab::Ci::Config::Entry::Stages.default)
2018-12-05 23:21:45 +05:30
end
end
end