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/services/clusters/applications/check_uninstall_progress_service_spec.rb')
-rw-r--r--spec/services/clusters/applications/check_uninstall_progress_service_spec.rb23
1 files changed, 20 insertions, 3 deletions
diff --git a/spec/services/clusters/applications/check_uninstall_progress_service_spec.rb b/spec/services/clusters/applications/check_uninstall_progress_service_spec.rb
index ccae7fd133f..084f29d9d2d 100644
--- a/spec/services/clusters/applications/check_uninstall_progress_service_spec.rb
+++ b/spec/services/clusters/applications/check_uninstall_progress_service_spec.rb
@@ -56,13 +56,30 @@ describe Clusters::Applications::CheckUninstallProgressService do
service.execute
end
- it 'make the application installed' do
+ it 'destroys the application' do
expect(worker_class).not_to receive(:perform_in)
service.execute
+ expect(application).to be_destroyed
+ end
+
+ context 'an error occurs while destroying' do
+ before do
+ expect(application).to receive(:destroy!).once.and_raise("destroy failed")
+ end
+
+ it 'still removes the installation POD' do
+ expect(service).to receive(:remove_installation_pod).once
- expect(application).to be_uninstalled
- expect(application.status_reason).to be_nil
+ service.execute
+ end
+
+ it 'makes the application uninstall_errored' do
+ service.execute
+
+ expect(application).to be_uninstall_errored
+ expect(application.status_reason).to eq('Application uninstalled but failed to destroy: destroy failed')
+ end
end
end