Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/clusters/applications/prometheus_spec.rb')
-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