diff options
author | Paul 🐻 <paul@bonaud.fr> | 2019-04-05 09:44:33 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-04-05 09:44:33 +0300 |
commit | 9f36097db2a5901312d7ea86c5a0df315311b7ff (patch) | |
tree | 64b62bc94d40fb2780904cf5ae7e3178a8c5a61a /spec/lib | |
parent | 48022ab3e843c8a4e747fd1a4009656703283044 (diff) |
fix(gitlab-ci-config): allow strings in the 'include' keyword
This fix is a followup to !24098 which introduced a validation of the
`include:` keyword of a gitlab-ci configuration file when triggered
from /ci/lint API calls.
However, there was a test case missing: the case of a single string as
value. I have added a test case for that which shows that the code was
not validating it correctly.
This commit fixes that to allow all `include:` valid inputs.
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/ci/yaml_processor_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/yaml_processor_spec.rb b/spec/lib/gitlab/ci/yaml_processor_spec.rb index 63a0d54dcfc..8b39c4e4dd0 100644 --- a/spec/lib/gitlab/ci/yaml_processor_spec.rb +++ b/spec/lib/gitlab/ci/yaml_processor_spec.rb @@ -615,6 +615,14 @@ module Gitlab subject { Gitlab::Ci::YamlProcessor.new(YAML.dump(config), opts) } context "when validating a ci config file with no project context" do + context "when a single string is provided" do + let(:include_content) { "/local.gitlab-ci.yml" } + + it "does not return any error" do + expect { subject }.not_to raise_error + end + end + context "when an array is provided" do let(:include_content) { ["/local.gitlab-ci.yml"] } |