diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 00:10:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 00:10:16 +0300 |
commit | 039b920db38c464de624710acec581be5a0eb961 (patch) | |
tree | 77eb43daaa9b25b6f8673433faf2e809992474a6 /spec/policies | |
parent | 042cd704b8177e7997af4a2ca90967d3178ccc3f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies')
-rw-r--r-- | spec/policies/project_policy_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/policies/project_policy_spec.rb b/spec/policies/project_policy_spec.rb index cc837e7544c..46da42a4787 100644 --- a/spec/policies/project_policy_spec.rb +++ b/spec/policies/project_policy_spec.rb @@ -393,6 +393,34 @@ RSpec.describe ProjectPolicy do end end + describe 'read_storage_disk_path' do + context 'when no user' do + let(:current_user) { anonymous } + + it { expect_disallowed(:read_storage_disk_path) } + end + + context 'admin' do + let(:current_user) { admin } + + context 'when admin mode is enabled', :enable_admin_mode do + it { expect_allowed(:read_storage_disk_path) } + end + + context 'when admin mode is disabled' do + it { expect_disallowed(:read_storage_disk_path) } + end + end + + %w(guest reporter developer maintainer owner).each do |role| + context role do + let(:current_user) { send(role) } + + it { expect_disallowed(:read_storage_disk_path) } + end + end + end + context 'alert bot' do let(:current_user) { User.alert_bot } |