diff options
Diffstat (limited to 'spec/support/shared_examples/policies')
-rw-r--r-- | spec/support/shared_examples/policies/project_policy_shared_examples.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/support/shared_examples/policies/project_policy_shared_examples.rb b/spec/support/shared_examples/policies/project_policy_shared_examples.rb index 013c9b61b99..a4243db6bc9 100644 --- a/spec/support/shared_examples/policies/project_policy_shared_examples.rb +++ b/spec/support/shared_examples/policies/project_policy_shared_examples.rb @@ -330,3 +330,18 @@ RSpec.shared_examples 'project policies as admin without admin mode' do end end end + +RSpec.shared_examples 'package access with repository disabled' do + context 'when repository is disabled' do + before do + project.project_feature.update!( + # Disable merge_requests and builds as well, since merge_requests and + # builds cannot have higher visibility than repository. + merge_requests_access_level: ProjectFeature::DISABLED, + builds_access_level: ProjectFeature::DISABLED, + repository_access_level: ProjectFeature::DISABLED) + end + + it { is_expected.to be_allowed(:read_package) } + end +end |