summaryrefslogtreecommitdiff
path: root/spec/models/clusters/applications
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-20 15:08:44 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-20 15:08:44 +0000
commitb9bac6dbf78a5a7976fba14aaeef96bdeb0da612 (patch)
treeffe277b562256f718b0818e8fd3c8fd8766d0269 /spec/models/clusters/applications
parent8c4198cbe631278e87fee04157d23494fbb80cdb (diff)
downloadgitlab-ce-b9bac6dbf78a5a7976fba14aaeef96bdeb0da612.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/clusters/applications')
-rw-r--r--spec/models/clusters/applications/prometheus_spec.rb35
1 files changed, 13 insertions, 22 deletions
diff --git a/spec/models/clusters/applications/prometheus_spec.rb b/spec/models/clusters/applications/prometheus_spec.rb
index ba344a234b8..04e4d261b1c 100644
--- a/spec/models/clusters/applications/prometheus_spec.rb
+++ b/spec/models/clusters/applications/prometheus_spec.rb
@@ -274,7 +274,8 @@ describe Clusters::Applications::Prometheus do
subject { application.files_with_replaced_values({ hello: :world }) }
it 'does not modify #files' do
- expect(subject[:'values.yaml']).not_to eq(files)
+ expect(subject[:'values.yaml']).not_to eq(files[:'values.yaml'])
+
expect(files[:'values.yaml']).to eq(application.values)
end
@@ -282,27 +283,17 @@ describe Clusters::Applications::Prometheus do
expect(subject[:'values.yaml']).to eq({ hello: :world })
end
- it 'includes cert files' do
- expect(subject[:'ca.pem']).to be_present
- expect(subject[:'ca.pem']).to eq(application.cluster.application_helm.ca_cert)
-
- expect(subject[:'cert.pem']).to be_present
- expect(subject[:'key.pem']).to be_present
-
- cert = OpenSSL::X509::Certificate.new(subject[:'cert.pem'])
- expect(cert.not_after).to be < 60.minutes.from_now
- end
-
- context 'when the helm application does not have a ca_cert' do
- before do
- application.cluster.application_helm.ca_cert = nil
- end
-
- it 'does not include cert files' do
- expect(subject[:'ca.pem']).not_to be_present
- expect(subject[:'cert.pem']).not_to be_present
- expect(subject[:'key.pem']).not_to be_present
- end
+ it 'uses values from #files, except for values.yaml' do
+ allow(application).to receive(:files).and_return({
+ 'values.yaml': 'some value specific to files',
+ 'file_a.txt': 'file_a',
+ 'file_b.txt': 'file_b'
+ })
+
+ expect(subject.except(:'values.yaml')).to eq({
+ 'file_a.txt': 'file_a',
+ 'file_b.txt': 'file_b'
+ })
end
end