summaryrefslogtreecommitdiff
path: root/spec/lib/ci
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-09-19 13:31:42 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-09-19 13:31:42 +0200
commit967eb8fb550b8225177b8cb7f87afd81cfd0c213 (patch)
treed1d458a0e1d8c5448f2ae8db7415f770aa9bddaf /spec/lib/ci
parent748dd35c65b0a7f3fbb0832fd18933ff8c19ef7d (diff)
parentc20e4267e89c1fa84b3eeb9f63e17677388c25e3 (diff)
downloadgitlab-ce-967eb8fb550b8225177b8cb7f87afd81cfd0c213.tar.gz
Merge branch 'master' into per-build-token
Diffstat (limited to 'spec/lib/ci')
-rw-r--r--spec/lib/ci/gitlab_ci_yaml_processor_spec.rb21
1 files changed, 18 insertions, 3 deletions
diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
index af192664b33..6dedd25e9d3 100644
--- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
@@ -754,6 +754,20 @@ module Ci
it 'does return production' do
expect(builds.size).to eq(1)
expect(builds.first[:environment]).to eq(environment)
+ expect(builds.first[:options]).to include(environment: { name: environment })
+ end
+ end
+
+ context 'when hash is specified' do
+ let(:environment) do
+ { name: 'production',
+ url: 'http://production.gitlab.com' }
+ end
+
+ it 'does return production and URL' do
+ expect(builds.size).to eq(1)
+ expect(builds.first[:environment]).to eq(environment[:name])
+ expect(builds.first[:options]).to include(environment: environment)
end
end
@@ -770,15 +784,16 @@ module Ci
let(:environment) { 1 }
it 'raises error' do
- expect { builds }.to raise_error("jobs:deploy_to_production environment #{Gitlab::Regex.environment_name_regex_message}")
+ expect { builds }.to raise_error(
+ 'jobs:deploy_to_production:environment config should be a hash or a string')
end
end
context 'is not a valid string' do
- let(:environment) { 'production staging' }
+ let(:environment) { 'production:staging' }
it 'raises error' do
- expect { builds }.to raise_error("jobs:deploy_to_production environment #{Gitlab::Regex.environment_name_regex_message}")
+ expect { builds }.to raise_error("jobs:deploy_to_production:environment name #{Gitlab::Regex.environment_name_regex_message}")
end
end
end