Welcome to mirror list, hosted at ThFree Co, Russian Federation.

templates_spec.rb « templates « ci « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b52064b303672cc7380f57c3537ad09d5fa2f08f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# frozen_string_literal: true

require 'spec_helper'

describe "CI YML Templates" do
  using RSpec::Parameterized::TableSyntax

  subject { Gitlab::Ci::YamlProcessor.new(content) }

  where(:template_name) do
    Gitlab::Template::GitlabCiYmlTemplate.all.map(&:full_name)
  end

  with_them do
    let(:content) do
      <<~EOS
        include:
          - template: #{template_name}

        concrete_build_implemented_by_a_user:
          stage: test
          script: do something
      EOS
    end

    it 'is valid' do
      expect { subject }.not_to raise_error
    end

    it 'require default stages to be included' do
      expect(subject.stages).to include(*Gitlab::Ci::Config::Entry::Stages.default)
    end
  end
end