diff options
Diffstat (limited to 'spec/services/ci/create_pipeline_service_spec.rb')
-rw-r--r-- | spec/services/ci/create_pipeline_service_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb index de0f4841215..8f16d375f03 100644 --- a/spec/services/ci/create_pipeline_service_spec.rb +++ b/spec/services/ci/create_pipeline_service_spec.rb @@ -801,6 +801,32 @@ describe Ci::CreatePipelineService do end end + context 'environment with Kubernetes configuration' do + let(:kubernetes_namespace) { 'custom-namespace' } + + before do + config = YAML.dump( + deploy: { + environment: { + name: "environment-name", + kubernetes: { namespace: kubernetes_namespace } + }, + script: 'ls' + } + ) + + stub_ci_pipeline_yaml_file(config) + end + + it 'stores the requested namespace' do + result = execute_service + build = result.builds.first + + expect(result).to be_persisted + expect(build.options.dig(:environment, :kubernetes, :namespace)).to eq(kubernetes_namespace) + end + end + context 'when environment with invalid name' do before do config = YAML.dump(deploy: { environment: { name: 'name,with,commas' }, script: 'ls' }) |