diff options
author | Chris Baumbauer <cab@cabnetworks.net> | 2018-11-06 11:52:15 -0800 |
---|---|---|
committer | Chris Baumbauer <cab@cabnetworks.net> | 2018-11-06 11:52:15 -0800 |
commit | e5c408e44549b2e8a32492ba6ab10b45727c44dd (patch) | |
tree | 3fd955907e16d7fc17247678dccf413d3d12e231 /spec/models/clusters/applications/knative_spec.rb | |
parent | 0d5be948056db6058cb3131b3d479d8d353d1c6c (diff) | |
download | gitlab-ce-e5c408e44549b2e8a32492ba6ab10b45727c44dd.tar.gz |
Refactor cluster application tests to centralize helm CA cert verification
Diffstat (limited to 'spec/models/clusters/applications/knative_spec.rb')
-rw-r--r-- | spec/models/clusters/applications/knative_spec.rb | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/spec/models/clusters/applications/knative_spec.rb b/spec/models/clusters/applications/knative_spec.rb index 7849e29d546..dff9684ab2a 100644 --- a/spec/models/clusters/applications/knative_spec.rb +++ b/spec/models/clusters/applications/knative_spec.rb @@ -5,6 +5,7 @@ describe Clusters::Applications::Knative do include_examples 'cluster application core specs', :clusters_applications_knative include_examples 'cluster application status specs', :clusters_applications_knative + include_examples 'cluster application helm specs', :clusters_applications_knative describe '.installed' do subject { described_class.installed } @@ -68,23 +69,5 @@ describe Clusters::Applications::Knative do it 'should include knative specific keys in the values.yaml file' do expect(values).to include('domain') end - - context 'when the helm application does not have a ca_cert' do - before do - application.cluster.application_helm.ca_cert = nil - end - - it 'should not include cert files when there is no ca_cert entry' do - expect(subject).not_to include(:'ca.pem', :'cert.pem', :'key.pem') - end - end - - it 'should include cert files when there is a ca_cert entry' do - expect(subject).to include(:'ca.pem', :'cert.pem', :'key.pem') - expect(subject[:'ca.pem']).to eq(application.cluster.application_helm.ca_cert) - - cert = OpenSSL::X509::Certificate.new(subject[:'cert.pem']) - expect(cert.not_after).to be < 60.minutes.from_now - end end end |