Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-10 18:09:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-10 18:09:19 +0300
commit758b97662c5a6af41357cec7e25fc8cddadd8b9c (patch)
tree8016bc1e0de1bdc3caf1c698231d85d501650a03 /spec/policies
parentf1cc2a347775059c48a92c96720baae93ceceb59 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies')
-rw-r--r--spec/policies/group_policy_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/policies/group_policy_spec.rb b/spec/policies/group_policy_spec.rb
index ff59a2e04a7..e8d3f165fb9 100644
--- a/spec/policies/group_policy_spec.rb
+++ b/spec/policies/group_policy_spec.rb
@@ -1171,6 +1171,24 @@ RSpec.describe GroupPolicy do
end
end
+ describe 'change_prevent_sharing_groups_outside_hierarchy' do
+ context 'with owner' do
+ let(:current_user) { owner }
+
+ it { is_expected.to be_allowed(:change_prevent_sharing_groups_outside_hierarchy) }
+ end
+
+ context 'with non-owner roles' do
+ where(role: %w[admin maintainer reporter developer guest])
+
+ with_them do
+ let(:current_user) { public_send role }
+
+ it { is_expected.to be_disallowed(:change_prevent_sharing_groups_outside_hierarchy) }
+ end
+ end
+ end
+
context 'with customer relations feature flag disabled' do
let(:current_user) { owner }