debian-mirror-gitlab/spec/workers/authorized_project_update/user_refresh_over_user_range_worker_spec.rb
2020-07-01 16:08:20 +05:30

31 lines
948 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe AuthorizedProjectUpdate::UserRefreshOverUserRangeWorker do
let(:start_user_id) { 42 }
let(:end_user_id) { 4242 }
describe '#perform' do
it 'calls AuthorizedProjectUpdate::RecalculateForUserRangeService' do
expect_next_instance_of(AuthorizedProjectUpdate::RecalculateForUserRangeService) do |service|
expect(service).to receive(:execute)
end
subject.perform(start_user_id, end_user_id)
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::RecalculateForUserRangeService' do
expect(AuthorizedProjectUpdate::RecalculateForUserRangeService).not_to receive(:new)
subject.perform(start_user_id, end_user_id)
end
end
end
end