2021-09-30 23:02:18 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe Members::Groups::CreatorService do
|
|
|
|
describe '.access_levels' do
|
|
|
|
it 'returns Gitlab::Access.options_with_owner' do
|
|
|
|
expect(described_class.access_levels).to eq(Gitlab::Access.sym_options_with_owner)
|
|
|
|
end
|
|
|
|
end
|
2022-07-16 23:28:13 +05:30
|
|
|
|
|
|
|
describe '#execute' do
|
|
|
|
let_it_be(:source, reload: true) { create(:group, :public) }
|
|
|
|
let_it_be(:user) { create(:user) }
|
|
|
|
|
|
|
|
it_behaves_like 'member creation' do
|
|
|
|
let_it_be(:member_type) { GroupMember }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'authorized projects update' do
|
|
|
|
it 'schedules a single project authorization update job when called multiple times' do
|
|
|
|
expect(AuthorizedProjectsWorker).to receive(:bulk_perform_and_wait).once
|
|
|
|
|
|
|
|
1.upto(3) do
|
|
|
|
described_class.new(source, user, :maintainer).execute
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2021-09-30 23:02:18 +05:30
|
|
|
end
|