diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/services/groups/group_links/create_service_spec.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/services/groups/group_links/create_service_spec.rb')
-rw-r--r-- | spec/services/groups/group_links/create_service_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/services/groups/group_links/create_service_spec.rb b/spec/services/groups/group_links/create_service_spec.rb index b1bb9a8de23..03dac14be54 100644 --- a/spec/services/groups/group_links/create_service_spec.rb +++ b/spec/services/groups/group_links/create_service_spec.rb @@ -6,18 +6,20 @@ RSpec.describe Groups::GroupLinks::CreateService, '#execute' do let(:parent_group_user) { create(:user) } let(:group_user) { create(:user) } let(:child_group_user) { create(:user) } + let(:prevent_sharing) { false } let_it_be(:group_parent) { create(:group, :private) } let_it_be(:group) { create(:group, :private, parent: group_parent) } let_it_be(:group_child) { create(:group, :private, parent: group) } - let_it_be(:shared_group_parent, refind: true) { create(:group, :private) } - let_it_be(:shared_group, refind: true) { create(:group, :private, parent: shared_group_parent) } - let_it_be(:shared_group_child) { create(:group, :private, parent: shared_group) } + let(:ns_for_parent) { create(:namespace_settings, prevent_sharing_groups_outside_hierarchy: prevent_sharing) } + let(:shared_group_parent) { create(:group, :private, namespace_settings: ns_for_parent) } + let(:shared_group) { create(:group, :private, parent: shared_group_parent) } + let(:shared_group_child) { create(:group, :private, parent: shared_group) } - let_it_be(:project_parent) { create(:project, group: shared_group_parent) } - let_it_be(:project) { create(:project, group: shared_group) } - let_it_be(:project_child) { create(:project, group: shared_group_child) } + let(:project_parent) { create(:project, group: shared_group_parent) } + let(:project) { create(:project, group: shared_group) } + let(:project_child) { create(:project, group: shared_group_child) } let(:opts) do { @@ -129,9 +131,7 @@ RSpec.describe Groups::GroupLinks::CreateService, '#execute' do end context 'sharing outside the hierarchy is disabled' do - before do - shared_group_parent.namespace_settings.update!(prevent_sharing_groups_outside_hierarchy: true) - end + let(:prevent_sharing) { true } it 'prevents sharing with a group outside the hierarchy' do result = subject.execute |