diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-13 03:10:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-13 03:10:17 +0300 |
commit | dce8d0c6a7fdc7cca4df3b00b11d68000d117e2f (patch) | |
tree | ae6060a584549cfcecced34eea93e2b4fe5c64ed /spec/models/packages/protection/rule_spec.rb | |
parent | 74cb1a1df361969e97d1a85683c1dfca5ac8cad1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/packages/protection/rule_spec.rb')
-rw-r--r-- | spec/models/packages/protection/rule_spec.rb | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/spec/models/packages/protection/rule_spec.rb b/spec/models/packages/protection/rule_spec.rb index b368687e6d8..d59c374b442 100644 --- a/spec/models/packages/protection/rule_spec.rb +++ b/spec/models/packages/protection/rule_spec.rb @@ -10,9 +10,19 @@ RSpec.describe Packages::Protection::Rule, type: :model, feature_category: :pack end describe 'enums' do - describe '#package_type' do - it { is_expected.to define_enum_for(:package_type).with_values(npm: Packages::Package.package_types[:npm]) } - end + it { is_expected.to define_enum_for(:package_type).with_values(npm: Packages::Package.package_types[:npm]) } + + it { + is_expected.to( + define_enum_for(:push_protected_up_to_access_level) + .with_values( + developer: Gitlab::Access::DEVELOPER, + maintainer: Gitlab::Access::MAINTAINER, + owner: Gitlab::Access::OWNER + ) + .with_prefix(:push_protected_up_to) + ) + } end describe 'validations' do @@ -30,11 +40,6 @@ RSpec.describe Packages::Protection::Rule, type: :model, feature_category: :pack describe '#push_protected_up_to_access_level' do it { is_expected.to validate_presence_of(:push_protected_up_to_access_level) } - - it { - is_expected.to validate_inclusion_of(:push_protected_up_to_access_level).in_array([Gitlab::Access::DEVELOPER, - Gitlab::Access::MAINTAINER, Gitlab::Access::OWNER]) - } end end end |