summaryrefslogtreecommitdiff
path: root/spec/workers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 18:10:35 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 18:10:35 +0000
commit3597fb6d337baab5847863feedc98b433fb4000c (patch)
tree7c2cf77f03fc2dc43af4198bdddc75221edacaac /spec/workers
parentec4abad65d774cfc94110577589d44de5da825de (diff)
downloadgitlab-ce-3597fb6d337baab5847863feedc98b433fb4000c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/container_expiration_policy_worker_spec.rb14
-rw-r--r--spec/workers/web_hook_worker_spec.rb1
2 files changed, 14 insertions, 1 deletions
diff --git a/spec/workers/container_expiration_policy_worker_spec.rb b/spec/workers/container_expiration_policy_worker_spec.rb
index 8562935b0b5..6f81d06f653 100644
--- a/spec/workers/container_expiration_policy_worker_spec.rb
+++ b/spec/workers/container_expiration_policy_worker_spec.rb
@@ -123,5 +123,19 @@ RSpec.describe ContainerExpirationPolicyWorker do
expect(stuck_cleanup.reload).to be_cleanup_unfinished
end
end
+
+ context 'policies without container repositories' do
+ let_it_be(:container_expiration_policy1) { create(:container_expiration_policy, enabled: true) }
+ let_it_be(:container_repository1) { create(:container_repository, project_id: container_expiration_policy1.project_id) }
+ let_it_be(:container_expiration_policy2) { create(:container_expiration_policy, enabled: true) }
+ let_it_be(:container_repository2) { create(:container_repository, project_id: container_expiration_policy2.project_id) }
+ let_it_be(:container_expiration_policy3) { create(:container_expiration_policy, enabled: true) }
+
+ it 'disables them' do
+ expect { subject }
+ .to change { ::ContainerExpirationPolicy.active.count }.from(3).to(2)
+ expect(container_expiration_policy3.reload.enabled).to be false
+ end
+ end
end
end
diff --git a/spec/workers/web_hook_worker_spec.rb b/spec/workers/web_hook_worker_spec.rb
index 548cf4c717a..a86964aa417 100644
--- a/spec/workers/web_hook_worker_spec.rb
+++ b/spec/workers/web_hook_worker_spec.rb
@@ -17,7 +17,6 @@ RSpec.describe WebHookWorker do
it_behaves_like 'worker with data consistency',
described_class,
- feature_flag: :load_balancing_for_web_hook_worker,
data_consistency: :delayed
end
end