summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/models/cluster_cleanup_worker_base_shared_examples.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 03:06:07 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 03:06:07 +0000
commit7f3bff1556594dcdc1beca40d083ba7263965e21 (patch)
treeab18d957d9bc7b2888c6e9fa9b281a7c1cb8927b /spec/support/shared_examples/models/cluster_cleanup_worker_base_shared_examples.rb
parent8d0aed5e4a6ae59232cfa5ca168fa1b87073520d (diff)
downloadgitlab-ce-7f3bff1556594dcdc1beca40d083ba7263965e21.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_examples/models/cluster_cleanup_worker_base_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/models/cluster_cleanup_worker_base_shared_examples.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/support/shared_examples/models/cluster_cleanup_worker_base_shared_examples.rb b/spec/support/shared_examples/models/cluster_cleanup_worker_base_shared_examples.rb
new file mode 100644
index 00000000000..66bbd908ea8
--- /dev/null
+++ b/spec/support/shared_examples/models/cluster_cleanup_worker_base_shared_examples.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+shared_examples 'cluster cleanup worker base specs' do
+ it 'transitions to errored if sidekiq retries exhausted' do
+ job = { 'args' => [cluster.id, 0], 'jid' => '123' }
+
+ described_class.sidekiq_retries_exhausted_block.call(job)
+
+ expect(cluster.reload.cleanup_status_name).to eq(:cleanup_errored)
+ end
+end