diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-11-07 15:00:38 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-11-07 15:00:38 +0000 |
commit | 5dc0577b84b9d41b1e2a6e781dfeaa400e8e2c10 (patch) | |
tree | 06954c98466840c21b88de8c929a36086d1310a2 /spec/services | |
parent | fadaa3d181b26c420a2424d35780cddc9fc32ce0 (diff) | |
parent | c2097ed74cc832972142d24f3cda1faf7a96d550 (diff) | |
download | gitlab-ce-5dc0577b84b9d41b1e2a6e781dfeaa400e8e2c10.tar.gz |
Merge branch 'triggermesh-phase1-knative' into 'master'
Allow to install Knative as cluster application
See merge request gitlab-org/gitlab-ce!22593
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/clusters/applications/create_service_spec.rb | 33 | ||||
-rw-r--r-- | spec/services/clusters/gcp/finalize_creation_service_spec.rb | 2 |
2 files changed, 34 insertions, 1 deletions
diff --git a/spec/services/clusters/applications/create_service_spec.rb b/spec/services/clusters/applications/create_service_spec.rb index 056db0c5486..a9985133b93 100644 --- a/spec/services/clusters/applications/create_service_spec.rb +++ b/spec/services/clusters/applications/create_service_spec.rb @@ -67,5 +67,38 @@ describe Clusters::Applications::CreateService do expect { subject }.to raise_error(Clusters::Applications::CreateService::InvalidApplicationError) end end + + context 'knative application' do + let(:params) do + { + application: 'knative', + hostname: 'example.com' + } + end + + before do + allow_any_instance_of(Clusters::Applications::ScheduleInstallationService).to receive(:execute) + end + + it 'creates the application' do + expect do + subject + + cluster.reload + end.to change(cluster, :application_knative) + end + + it 'sets the hostname' do + expect(subject.hostname).to eq('example.com') + end + end + + context 'invalid application' do + let(:params) { { application: 'non-existent' } } + + it 'raises an error' do + expect { subject }.to raise_error(Clusters::Applications::CreateService::InvalidApplicationError) + end + end end end diff --git a/spec/services/clusters/gcp/finalize_creation_service_spec.rb b/spec/services/clusters/gcp/finalize_creation_service_spec.rb index 7fbb6cf2cf5..efee158739d 100644 --- a/spec/services/clusters/gcp/finalize_creation_service_spec.rb +++ b/spec/services/clusters/gcp/finalize_creation_service_spec.rb @@ -33,7 +33,7 @@ describe Clusters::Gcp::FinalizeCreationService, '#execute' do expect(provider.endpoint).to eq(endpoint) expect(platform.api_url).to eq(api_url) - expect(platform.ca_cert).to eq(Base64.decode64(load_sample_cert)) + expect(platform.ca_cert).to eq(Base64.decode64(load_sample_cert).strip) expect(platform.username).to eq(username) expect(platform.password).to eq(password) expect(platform.token).to eq(token) |