summaryrefslogtreecommitdiff
path: root/spec/workers
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2019-04-10 14:50:14 +1200
committerStan Hu <stanhu@gmail.com>2019-04-29 22:55:11 -0700
commit938e90f47288901790a96c50a8c0dfa2b7eab137 (patch)
treeb7496ad378885c6aee32b199906386812cedf9d8 /spec/workers
parent33a765c17a246e4a2376056b1c301707c78806d0 (diff)
downloadgitlab-ce-938e90f47288901790a96c50a8c0dfa2b7eab137.tar.gz
Services to uninstall cluster application
+ to monitor progress of uninstallation pod
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/clusters/applications/wait_for_uninstall_app_worker_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/workers/clusters/applications/wait_for_uninstall_app_worker_spec.rb b/spec/workers/clusters/applications/wait_for_uninstall_app_worker_spec.rb
new file mode 100644
index 00000000000..aaf5c9defc4
--- /dev/null
+++ b/spec/workers/clusters/applications/wait_for_uninstall_app_worker_spec.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe Clusters::Applications::WaitForUninstallAppWorker, '#perform' do
+ let(:app) { create(:clusters_applications_helm) }
+ let(:app_name) { app.name }
+ let(:app_id) { app.id }
+
+ subject { described_class.new.perform(app_name, app_id) }
+
+ context 'app exists' do
+ let(:service) { instance_double(Clusters::Applications::CheckUninstallProgressService) }
+
+ it 'calls the check service' do
+ expect(Clusters::Applications::CheckUninstallProgressService).to receive(:new).with(app).and_return(service)
+ expect(service).to receive(:execute).once
+
+ subject
+ end
+ end
+
+ context 'app does not exist' do
+ let(:app_id) { 0 }
+
+ it 'does not call the check service' do
+ expect(Clusters::Applications::CheckUninstallProgressService).not_to receive(:new)
+
+ expect { subject }.to raise_error(ActiveRecord::RecordNotFound)
+ end
+ end
+end