diff options
author | Thong Kuah <tkuah@gitlab.com> | 2019-04-10 01:57:23 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-04-30 08:55:11 +0300 |
commit | 33a765c17a246e4a2376056b1c301707c78806d0 (patch) | |
tree | 84ff3d03efbcdd0470b3e881a990e4ed9380e0ea /spec/lib/gitlab/kubernetes/helm | |
parent | 43be4d54f3940633ad76e746a9a999c4a9a65870 (diff) |
Teach Helm::Api about #uninstall
Diffstat (limited to 'spec/lib/gitlab/kubernetes/helm')
-rw-r--r-- | spec/lib/gitlab/kubernetes/helm/api_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/lib/gitlab/kubernetes/helm/api_spec.rb b/spec/lib/gitlab/kubernetes/helm/api_spec.rb index 8433d40b2ea..24ce397ec3d 100644 --- a/spec/lib/gitlab/kubernetes/helm/api_spec.rb +++ b/spec/lib/gitlab/kubernetes/helm/api_spec.rb @@ -33,6 +33,28 @@ describe Gitlab::Kubernetes::Helm::Api do end end + describe '#uninstall' do + before do + allow(client).to receive(:create_pod).and_return(nil) + allow(client).to receive(:delete_pod).and_return(nil) + allow(namespace).to receive(:ensure_exists!).once + end + + it 'ensures the namespace exists before creating the POD' do + expect(namespace).to receive(:ensure_exists!).once.ordered + expect(client).to receive(:create_pod).once.ordered + + subject.uninstall(command) + end + + it 'removes an existing pod before installing' do + expect(client).to receive(:delete_pod).with('install-app-name', 'gitlab-managed-apps').once.ordered + expect(client).to receive(:create_pod).once.ordered + + subject.uninstall(command) + end + end + describe '#install' do before do allow(client).to receive(:create_pod).and_return(nil) |