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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-04-03 23:51:00 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2019-04-05 11:13:49 +0300
commite0df05cfbc7f03e8fce27c5e93fda17f634721e7 (patch)
treef0e04117e15e4fe3ea3502c72261dd1aed51e7d8 /spec/lib/gitlab/ci/yaml_processor_spec.rb
parent6d000c9f9cbc65f92ed27ea55a14e5de9b11320d (diff)
Require all templates to use default stages
Our templates are free to override the 'stages:'. However, they should follow the convention to always include 'build', 'test', 'deploy' which are defaults when not defined.
Diffstat (limited to 'spec/lib/gitlab/ci/yaml_processor_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/yaml_processor_spec.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/lib/gitlab/ci/yaml_processor_spec.rb b/spec/lib/gitlab/ci/yaml_processor_spec.rb
index 63a0d54dcfc..518dd59d4a9 100644
--- a/spec/lib/gitlab/ci/yaml_processor_spec.rb
+++ b/spec/lib/gitlab/ci/yaml_processor_spec.rb
@@ -618,8 +618,8 @@ module Gitlab
context "when an array is provided" do
let(:include_content) { ["/local.gitlab-ci.yml"] }
- it "does not return any error" do
- expect { subject }.not_to raise_error
+ it "returns a validation error" do
+ expect { subject }.to raise_error(Gitlab::Ci::YamlProcessor::ValidationError, /does not have project/)
end
end
@@ -635,11 +635,18 @@ module Gitlab
let(:include_content) do
[
'https://gitlab.com/awesome-project/raw/master/.before-script-template.yml',
- '/templates/.after-script-template.yml',
{ template: 'Auto-DevOps.gitlab-ci.yml' }
]
end
+ before do
+ WebMock.stub_request(:get, 'https://gitlab.com/awesome-project/raw/master/.before-script-template.yml')
+ .to_return(
+ status: 200,
+ headers: { 'Content-Type' => 'application/json' },
+ body: 'prepare: { script: ls -al }')
+ end
+
it "does not return any error" do
expect { subject }.not_to raise_error
end