diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/services/groups/group_links/destroy_service_spec.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) | |
download | gitlab-ce-8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781.tar.gz |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/services/groups/group_links/destroy_service_spec.rb')
-rw-r--r-- | spec/services/groups/group_links/destroy_service_spec.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/services/groups/group_links/destroy_service_spec.rb b/spec/services/groups/group_links/destroy_service_spec.rb index 284bcd0df2e..8989f024262 100644 --- a/spec/services/groups/group_links/destroy_service_spec.rb +++ b/spec/services/groups/group_links/destroy_service_spec.rb @@ -8,14 +8,20 @@ describe Groups::GroupLinks::DestroyService, '#execute' do let_it_be(:group) { create(:group, :private) } let_it_be(:shared_group) { create(:group, :private) } let_it_be(:project) { create(:project, group: shared_group) } + let_it_be(:owner) { create(:user) } - subject { described_class.new(nil, nil) } + before do + group.add_developer(owner) + shared_group.add_owner(owner) + end + + subject { described_class.new(shared_group, owner) } context 'single link' do let!(:link) { create(:group_group_link, shared_group: shared_group, shared_with_group: group) } it 'destroys link' do - expect { subject.execute(link) }.to change { GroupGroupLink.count }.from(1).to(0) + expect { subject.execute(link) }.to change { shared_group.shared_with_group_links.count }.from(1).to(0) end it 'revokes project authorization' do |