diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /spec/services/members | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'spec/services/members')
-rw-r--r-- | spec/services/members/groups/creator_service_spec.rb | 5 | ||||
-rw-r--r-- | spec/services/members/invite_service_spec.rb | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/spec/services/members/groups/creator_service_spec.rb b/spec/services/members/groups/creator_service_spec.rb index 4130fbd44fa..fced7195046 100644 --- a/spec/services/members/groups/creator_service_spec.rb +++ b/spec/services/members/groups/creator_service_spec.rb @@ -27,7 +27,10 @@ RSpec.describe Members::Groups::CreatorService do 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 + # this is inline with the overridden behaviour in stubbed_member.rb + worker_instance = AuthorizedProjectsWorker.new + expect(AuthorizedProjectsWorker).to receive(:new).once.and_return(worker_instance) + expect(worker_instance).to receive(:perform).with(user.id) 1.upto(3) do described_class.add_member(source, user, :maintainer) diff --git a/spec/services/members/invite_service_spec.rb b/spec/services/members/invite_service_spec.rb index d25c8996931..6dbe161ee02 100644 --- a/spec/services/members/invite_service_spec.rb +++ b/spec/services/members/invite_service_spec.rb @@ -455,7 +455,7 @@ RSpec.describe Members::InviteService, :aggregate_failures, :clean_gitlab_redis_ end context 'when access_level is lower than inheriting member' do - let(:params) { { user_id: group_member.user_id, access_level: ProjectMember::GUEST }} + let(:params) { { user_id: group_member.user_id, access_level: ProjectMember::GUEST } } it 'does not add the member and returns an error' do msg = "Access level should be greater than or equal " \ @@ -467,7 +467,7 @@ RSpec.describe Members::InviteService, :aggregate_failures, :clean_gitlab_redis_ end context 'when access_level is the same as the inheriting member' do - let(:params) { { user_id: group_member.user_id, access_level: ProjectMember::DEVELOPER }} + let(:params) { { user_id: group_member.user_id, access_level: ProjectMember::DEVELOPER } } it 'adds the member with correct access_level' do expect_to_create_members(count: 1) @@ -477,7 +477,7 @@ RSpec.describe Members::InviteService, :aggregate_failures, :clean_gitlab_redis_ end context 'when access_level is greater than the inheriting member' do - let(:params) { { user_id: group_member.user_id, access_level: ProjectMember::MAINTAINER }} + let(:params) { { user_id: group_member.user_id, access_level: ProjectMember::MAINTAINER } } it 'adds the member with correct access_level' do expect_to_create_members(count: 1) |