summaryrefslogtreecommitdiff
path: root/spec/features/security/group/public_access_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/security/group/public_access_spec.rb')
-rw-r--r--spec/features/security/group/public_access_spec.rb35
1 files changed, 30 insertions, 5 deletions
diff --git a/spec/features/security/group/public_access_spec.rb b/spec/features/security/group/public_access_spec.rb
index ee72b84616a..90de2b58044 100644
--- a/spec/features/security/group/public_access_spec.rb
+++ b/spec/features/security/group/public_access_spec.rb
@@ -24,7 +24,12 @@ RSpec.describe 'Public Group access' do
describe 'GET /groups/:path' do
subject { group_path(group) }
- it { is_expected.to be_allowed_for(:admin) }
+ context 'when admin mode is enabled', :enable_admin_mode do
+ it { is_expected.to be_allowed_for(:admin) }
+ end
+ context 'when admin mode is disabled' do
+ it { is_expected.to be_allowed_for(:admin) }
+ end
it { is_expected.to be_allowed_for(:owner).of(group) }
it { is_expected.to be_allowed_for(:maintainer).of(group) }
it { is_expected.to be_allowed_for(:developer).of(group) }
@@ -39,7 +44,12 @@ RSpec.describe 'Public Group access' do
describe 'GET /groups/:path/-/issues' do
subject { issues_group_path(group) }
- it { is_expected.to be_allowed_for(:admin) }
+ context 'when admin mode is enabled', :enable_admin_mode do
+ it { is_expected.to be_allowed_for(:admin) }
+ end
+ context 'when admin mode is disabled' do
+ it { is_expected.to be_allowed_for(:admin) }
+ end
it { is_expected.to be_allowed_for(:owner).of(group) }
it { is_expected.to be_allowed_for(:maintainer).of(group) }
it { is_expected.to be_allowed_for(:developer).of(group) }
@@ -56,7 +66,12 @@ RSpec.describe 'Public Group access' do
subject { merge_requests_group_path(group) }
- it { is_expected.to be_allowed_for(:admin) }
+ context 'when admin mode is enabled', :enable_admin_mode do
+ it { is_expected.to be_allowed_for(:admin) }
+ end
+ context 'when admin mode is disabled' do
+ it { is_expected.to be_allowed_for(:admin) }
+ end
it { is_expected.to be_allowed_for(:owner).of(group) }
it { is_expected.to be_allowed_for(:maintainer).of(group) }
it { is_expected.to be_allowed_for(:developer).of(group) }
@@ -71,7 +86,12 @@ RSpec.describe 'Public Group access' do
describe 'GET /groups/:path/-/group_members' do
subject { group_group_members_path(group) }
- it { is_expected.to be_allowed_for(:admin) }
+ context 'when admin mode is enabled', :enable_admin_mode do
+ it { is_expected.to be_allowed_for(:admin) }
+ end
+ context 'when admin mode is disabled' do
+ it { is_expected.to be_allowed_for(:admin) }
+ end
it { is_expected.to be_allowed_for(:owner).of(group) }
it { is_expected.to be_allowed_for(:maintainer).of(group) }
it { is_expected.to be_allowed_for(:developer).of(group) }
@@ -86,7 +106,12 @@ RSpec.describe 'Public Group access' do
describe 'GET /groups/:path/-/edit' do
subject { edit_group_path(group) }
- it { is_expected.to be_allowed_for(:admin) }
+ context 'when admin mode is enabled', :enable_admin_mode do
+ it { is_expected.to be_allowed_for(:admin) }
+ end
+ context 'when admin mode is disabled' do
+ it { is_expected.to be_denied_for(:admin) }
+ end
it { is_expected.to be_allowed_for(:owner).of(group) }
it { is_expected.to be_denied_for(:maintainer).of(group) }
it { is_expected.to be_denied_for(:developer).of(group) }