diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-09-01 13:58:22 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-09-01 13:58:22 +0300 |
commit | 73d0cafbe4acf5a14ec196c3cfb38be4e84b67d9 (patch) | |
tree | 27e4388bda4234b80832d31c715379ce2ddf05b7 /spec/models/ci | |
parent | dc4d938676414579ad8cfca9689439668c90b411 (diff) |
Check if service active when using CI/CD kubernetes policy
Diffstat (limited to 'spec/models/ci')
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 7898bdbe2ff..cf4896ff188 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -546,42 +546,18 @@ describe Ci::Pipeline, :mailer do end end - context 'when kubernetes is configured' do - let(:project) { create(:kubernetes_project) } + describe '#has_kubernetes_active?' do + context 'when kubernetes is configured' do + let(:project) { create(:kubernetes_project) } - before do - create(:ci_variable, key: 'KUBE_DOMAIN', - protected: false, - project: project) - end - - describe '#context_variables' do - it 'returns kubernetes-related variables' do - variables = pipeline.context_variables.map { |v| v.fetch(:key) } - - expect(variables).to include 'KUBECONFIG', 'KUBE_DOMAIN' - end - end - - describe '#has_kubernetes_available?' do it 'returns true' do - expect(pipeline).to have_kubernetes_available - end - end - end - - context 'when kubernetes is not configured' do - describe '#context_variables' do - it 'does not return kubernetes related variables' do - variables = pipeline.context_variables.map { |v| v.fetch(:key) } - - expect(variables).not_to include 'KUBECONFIG', 'KUBE_DOMAIN' + expect(pipeline).to have_kubernetes_active end end - describe '#has_kubernetes_available?' do + context 'when kubernetes is not configured' do it 'returns false' do - expect(pipeline).not_to have_kubernetes_available + expect(pipeline).not_to have_kubernetes_active end end end |