diff options
author | Chris Baumbauer <cab@cabnetworks.net> | 2018-11-05 23:55:18 -0800 |
---|---|---|
committer | Chris Baumbauer <cab@cabnetworks.net> | 2018-11-05 23:55:18 -0800 |
commit | 97441486ceb3522fc5d3ff9e52a9d93e07bc8961 (patch) | |
tree | bc7774f06c43b3b6131b2e036cd3e1695f0b226c /spec/models/clusters/applications | |
parent | 1435fe60752728790544ed07bf4c95fc3ba39efe (diff) | |
download | gitlab-ce-97441486ceb3522fc5d3ff9e52a9d93e07bc8961.tar.gz |
Fix issue with missing knative cluster role binding, and cleanup tests
Diffstat (limited to 'spec/models/clusters/applications')
-rw-r--r-- | spec/models/clusters/applications/knative_spec.rb | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/spec/models/clusters/applications/knative_spec.rb b/spec/models/clusters/applications/knative_spec.rb index 6d72e3fba16..7849e29d546 100644 --- a/spec/models/clusters/applications/knative_spec.rb +++ b/spec/models/clusters/applications/knative_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' describe Clusters::Applications::Knative do - let(:knative) { create(:clusters_applications_knative, hostname: 'example.com') } + let(:knative) { create(:clusters_applications_knative) } include_examples 'cluster application core specs', :clusters_applications_knative include_examples 'cluster application status specs', :clusters_applications_knative @@ -47,7 +47,9 @@ describe Clusters::Applications::Knative do describe '#install_command' do subject { knative.install_command } - it { is_expected.to be_an_instance_of(Gitlab::Kubernetes::Helm::InstallCommand) } + it 'should be an instance of Helm::InstallCommand' do + expect(subject).to be_an_instance_of(Gitlab::Kubernetes::Helm::InstallCommand) + end it 'should be initialized with knative arguments' do expect(subject.name).to eq('knative') @@ -55,14 +57,6 @@ describe Clusters::Applications::Knative do expect(subject.version).to eq('0.1.3') expect(subject.files).to eq(knative.files) end - - context 'application failed to install previously' do - let(:knative) { create(:clusters_applications_knative, :errored, version: 'knative', hostname: 'example.com') } - - it 'should be initialized with the locked version' do - expect(subject.version).to eq('0.1.3') - end - end end describe '#files' do @@ -71,7 +65,7 @@ describe Clusters::Applications::Knative do subject { application.files } - it 'should include knative valid keys in values' do + it 'should include knative specific keys in the values.yaml file' do expect(values).to include('domain') end @@ -80,20 +74,15 @@ describe Clusters::Applications::Knative do application.cluster.application_helm.ca_cert = nil end - it 'should 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 + 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' do - expect(subject[:'ca.pem']).to be_present + 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) - 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 |