diff options
Diffstat (limited to 'spec/lib/sidebars/projects/menus/settings_menu_spec.rb')
-rw-r--r-- | spec/lib/sidebars/projects/menus/settings_menu_spec.rb | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/spec/lib/sidebars/projects/menus/settings_menu_spec.rb b/spec/lib/sidebars/projects/menus/settings_menu_spec.rb index d6136dddf40..f41f7a01d88 100644 --- a/spec/lib/sidebars/projects/menus/settings_menu_spec.rb +++ b/spec/lib/sidebars/projects/menus/settings_menu_spec.rb @@ -135,18 +135,20 @@ RSpec.describe Sidebars::Projects::Menus::SettingsMenu do describe 'Packages & Registries' do let(:item_id) { :packages_and_registries } + let(:packages_enabled) { false } before do stub_container_registry_config(enabled: container_enabled) + stub_config(packages: { enabled: packages_enabled }) end - describe 'when config registry setting is disabled' do + describe 'when container registry setting is disabled' do let(:container_enabled) { false } specify { is_expected.to be_nil } end - describe 'when config registry setting is enabled' do + describe 'when container registry setting is enabled' do let(:container_enabled) { true } specify { is_expected.not_to be_nil } @@ -157,6 +159,19 @@ RSpec.describe Sidebars::Projects::Menus::SettingsMenu do specify { is_expected.to be_nil } end end + + describe 'when package registry setting is enabled' do + let(:container_enabled) { false } + let(:packages_enabled) { true } + + specify { is_expected.not_to be_nil } + + describe 'when the user does not have access' do + let(:user) { nil } + + specify { is_expected.to be_nil } + end + end end describe 'Usage Quotas' do |