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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-23 22:44:23 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-23 22:44:23 +0300
commit6b96d119aec0ba674cca2c380cf60f1500306612 (patch)
treef7742d802f557d04e2144b06a2b47719fbd58b82 /spec/workers/authorized_project_update/periodic_recalculate_worker_spec.rb
parent8b7c4494871c7d69ac7bc59839bdce6ff2937f95 (diff)
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/workers/authorized_project_update/periodic_recalculate_worker_spec.rb')
-rw-r--r--spec/workers/authorized_project_update/periodic_recalculate_worker_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/workers/authorized_project_update/periodic_recalculate_worker_spec.rb b/spec/workers/authorized_project_update/periodic_recalculate_worker_spec.rb
new file mode 100644
index 00000000000..fcd073953b6
--- /dev/null
+++ b/spec/workers/authorized_project_update/periodic_recalculate_worker_spec.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe AuthorizedProjectUpdate::PeriodicRecalculateWorker do
+ describe '#perform' do
+ it 'calls AuthorizedProjectUpdate::PeriodicRecalculateService' do
+ expect_next_instance_of(AuthorizedProjectUpdate::PeriodicRecalculateService) do |service|
+ expect(service).to receive(:execute)
+ end
+
+ subject.perform
+ end
+
+ context 'feature flag :periodic_project_authorization_recalculation is disabled' do
+ before do
+ stub_feature_flags(periodic_project_authorization_recalculation: false)
+ end
+
+ it 'does not call AuthorizedProjectUpdate::PeriodicRecalculateService' do
+ expect(AuthorizedProjectUpdate::PeriodicRecalculateService).not_to receive(:new)
+
+ subject.perform
+ end
+ end
+ end
+end