diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 21:18:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 21:18:33 +0300 |
commit | f64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch) | |
tree | a2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /spec/lib/gitlab/visibility_level_spec.rb | |
parent | bfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff) |
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'spec/lib/gitlab/visibility_level_spec.rb')
-rw-r--r-- | spec/lib/gitlab/visibility_level_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/lib/gitlab/visibility_level_spec.rb b/spec/lib/gitlab/visibility_level_spec.rb index 63c31c82d59..0d34d22cbbe 100644 --- a/spec/lib/gitlab/visibility_level_spec.rb +++ b/spec/lib/gitlab/visibility_level_spec.rb @@ -131,4 +131,29 @@ RSpec.describe Gitlab::VisibilityLevel do end end end + + describe '.options' do + context 'keys' do + it 'returns the allowed visibility levels' do + expect(described_class.options.keys).to contain_exactly('Private', 'Internal', 'Public') + end + end + end + + describe '.level_name' do + using RSpec::Parameterized::TableSyntax + + where(:level_value, :level_name) do + described_class::PRIVATE | 'Private' + described_class::INTERNAL | 'Internal' + described_class::PUBLIC | 'Public' + non_existing_record_access_level | 'Unknown' + end + + with_them do + it 'returns the name of the visibility level' do + expect(described_class.level_name(level_value)).to eq(level_name) + end + end + end end |