From 6b96d119aec0ba674cca2c380cf60f1500306612 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 23 Jun 2020 19:44:23 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-1-stable-ee --- .../periodic_recalculate_worker_spec.rb | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 spec/workers/authorized_project_update/periodic_recalculate_worker_spec.rb (limited to 'spec/workers/authorized_project_update/periodic_recalculate_worker_spec.rb') 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 -- cgit v1.2.3