diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/services/members/projects/creator_service_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/services/members/projects/creator_service_spec.rb')
-rw-r--r-- | spec/services/members/projects/creator_service_spec.rb | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/spec/services/members/projects/creator_service_spec.rb b/spec/services/members/projects/creator_service_spec.rb index 7ba183759bc..7605238c3c5 100644 --- a/spec/services/members/projects/creator_service_spec.rb +++ b/spec/services/members/projects/creator_service_spec.rb @@ -3,14 +3,28 @@ require 'spec_helper' RSpec.describe Members::Projects::CreatorService do - it_behaves_like 'member creation' do - let_it_be(:source, reload: true) { create(:project, :public) } - let_it_be(:member_type) { ProjectMember } - end - describe '.access_levels' do it 'returns Gitlab::Access.sym_options_with_owner' do expect(described_class.access_levels).to eq(Gitlab::Access.sym_options_with_owner) end end + + describe '#execute' do + let_it_be(:source, reload: true) { create(:project, :public) } + let_it_be(:user) { create(:user) } + + it_behaves_like 'member creation' do + let_it_be(:member_type) { ProjectMember } + end + + context 'authorized projects update' do + it 'schedules a single project authorization update job when called multiple times' do + expect(AuthorizedProjectUpdate::UserRefreshFromReplicaWorker).to receive(:bulk_perform_in).once + + 1.upto(3) do + described_class.new(source, user, :maintainer).execute + end + end + end + end end |