summaryrefslogtreecommitdiff
path: root/spec/models/ci/pipeline_spec.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-09-01 12:58:22 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-09-01 12:58:22 +0200
commit73d0cafbe4acf5a14ec196c3cfb38be4e84b67d9 (patch)
tree27e4388bda4234b80832d31c715379ce2ddf05b7 /spec/models/ci/pipeline_spec.rb
parentdc4d938676414579ad8cfca9689439668c90b411 (diff)
downloadgitlab-ce-73d0cafbe4acf5a14ec196c3cfb38be4e84b67d9.tar.gz
Check if service active when using CI/CD kubernetes policy
Diffstat (limited to 'spec/models/ci/pipeline_spec.rb')
-rw-r--r--spec/models/ci/pipeline_spec.rb36
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