diff options
Diffstat (limited to 'spec/lib/sidebars')
-rw-r--r-- | spec/lib/sidebars/admin/panel_spec.rb | 1 | ||||
-rw-r--r-- | spec/lib/sidebars/groups/super_sidebar_panel_spec.rb | 1 | ||||
-rw-r--r-- | spec/lib/sidebars/organizations/panel_spec.rb | 1 | ||||
-rw-r--r-- | spec/lib/sidebars/organizations/super_sidebar_panel_spec.rb | 1 | ||||
-rw-r--r-- | spec/lib/sidebars/panel_spec.rb | 18 | ||||
-rw-r--r-- | spec/lib/sidebars/projects/super_sidebar_panel_spec.rb | 1 | ||||
-rw-r--r-- | spec/lib/sidebars/search/panel_spec.rb | 1 | ||||
-rw-r--r-- | spec/lib/sidebars/user_profile/panel_spec.rb | 1 | ||||
-rw-r--r-- | spec/lib/sidebars/user_settings/panel_spec.rb | 1 | ||||
-rw-r--r-- | spec/lib/sidebars/your_work/panel_spec.rb | 1 |
10 files changed, 22 insertions, 5 deletions
diff --git a/spec/lib/sidebars/admin/panel_spec.rb b/spec/lib/sidebars/admin/panel_spec.rb index 9c362f527f5..7e5b3fa54ad 100644 --- a/spec/lib/sidebars/admin/panel_spec.rb +++ b/spec/lib/sidebars/admin/panel_spec.rb @@ -28,4 +28,5 @@ RSpec.describe Sidebars::Admin::Panel, feature_category: :navigation do end it_behaves_like 'a panel with uniquely identifiable menu items' + it_behaves_like 'a panel instantiable by the anonymous user' end diff --git a/spec/lib/sidebars/groups/super_sidebar_panel_spec.rb b/spec/lib/sidebars/groups/super_sidebar_panel_spec.rb index 52c3a35a9d7..6da04178441 100644 --- a/spec/lib/sidebars/groups/super_sidebar_panel_spec.rb +++ b/spec/lib/sidebars/groups/super_sidebar_panel_spec.rb @@ -53,4 +53,5 @@ RSpec.describe Sidebars::Groups::SuperSidebarPanel, feature_category: :navigatio it_behaves_like 'a panel with uniquely identifiable menu items' it_behaves_like 'a panel with all menu_items categorized' + it_behaves_like 'a panel instantiable by the anonymous user' end diff --git a/spec/lib/sidebars/organizations/panel_spec.rb b/spec/lib/sidebars/organizations/panel_spec.rb index 1f0b8d72aef..edaa676aa41 100644 --- a/spec/lib/sidebars/organizations/panel_spec.rb +++ b/spec/lib/sidebars/organizations/panel_spec.rb @@ -14,4 +14,5 @@ RSpec.describe Sidebars::Organizations::Panel, feature_category: :navigation do end it_behaves_like 'a panel with uniquely identifiable menu items' + it_behaves_like 'a panel instantiable by the anonymous user' end diff --git a/spec/lib/sidebars/organizations/super_sidebar_panel_spec.rb b/spec/lib/sidebars/organizations/super_sidebar_panel_spec.rb index 99b33a5edf8..0e8a650652b 100644 --- a/spec/lib/sidebars/organizations/super_sidebar_panel_spec.rb +++ b/spec/lib/sidebars/organizations/super_sidebar_panel_spec.rb @@ -36,4 +36,5 @@ RSpec.describe Sidebars::Organizations::SuperSidebarPanel, feature_category: :na end it_behaves_like 'a panel with uniquely identifiable menu items' + it_behaves_like 'a panel instantiable by the anonymous user' end diff --git a/spec/lib/sidebars/panel_spec.rb b/spec/lib/sidebars/panel_spec.rb index 857cb1139b5..e4b3b973484 100644 --- a/spec/lib/sidebars/panel_spec.rb +++ b/spec/lib/sidebars/panel_spec.rb @@ -46,17 +46,25 @@ RSpec.describe Sidebars::Panel, feature_category: :navigation do end end - describe '#has_renderable_menus?' do - it 'returns false when no renderable menus' do - expect(panel.has_renderable_menus?).to be false + describe '#render?' do + it 'returns false with no menus' do + expect(panel.render?).to be false end - it 'returns true when no renderable menus' do + it 'returns false with no renderable menus' do + allow(menu1).to receive(:render?).and_return(false) + + panel.add_menu(menu1) + + expect(panel.render?).to be false + end + + it 'returns true with renderable menus' do allow(menu1).to receive(:render?).and_return(true) panel.add_menu(menu1) - expect(panel.has_renderable_menus?).to be true + expect(panel.render?).to be true end end diff --git a/spec/lib/sidebars/projects/super_sidebar_panel_spec.rb b/spec/lib/sidebars/projects/super_sidebar_panel_spec.rb index 3fc6cd5083f..e9cf6591037 100644 --- a/spec/lib/sidebars/projects/super_sidebar_panel_spec.rb +++ b/spec/lib/sidebars/projects/super_sidebar_panel_spec.rb @@ -64,4 +64,5 @@ RSpec.describe Sidebars::Projects::SuperSidebarPanel, feature_category: :navigat it_behaves_like 'a panel with uniquely identifiable menu items' it_behaves_like 'a panel with all menu_items categorized' + it_behaves_like 'a panel instantiable by the anonymous user' end diff --git a/spec/lib/sidebars/search/panel_spec.rb b/spec/lib/sidebars/search/panel_spec.rb index 39c0f112793..73f9fd2f103 100644 --- a/spec/lib/sidebars/search/panel_spec.rb +++ b/spec/lib/sidebars/search/panel_spec.rb @@ -12,6 +12,7 @@ RSpec.describe Sidebars::Search::Panel, feature_category: :navigation do subject { described_class.new(context) } it_behaves_like 'a panel with uniquely identifiable menu items' + it_behaves_like 'a panel instantiable by the anonymous user' describe '#aria_label' do it 'returns the correct aria label' do diff --git a/spec/lib/sidebars/user_profile/panel_spec.rb b/spec/lib/sidebars/user_profile/panel_spec.rb index a2bf490bc58..628b70c9100 100644 --- a/spec/lib/sidebars/user_profile/panel_spec.rb +++ b/spec/lib/sidebars/user_profile/panel_spec.rb @@ -11,6 +11,7 @@ RSpec.describe Sidebars::UserProfile::Panel, feature_category: :navigation do subject { described_class.new(context) } it_behaves_like 'a panel with uniquely identifiable menu items' + it_behaves_like 'a panel instantiable by the anonymous user' it 'implements #aria_label' do expect(subject.aria_label).to eq(s_('UserProfile|User profile navigation')) diff --git a/spec/lib/sidebars/user_settings/panel_spec.rb b/spec/lib/sidebars/user_settings/panel_spec.rb index d574652188d..c586ff9306d 100644 --- a/spec/lib/sidebars/user_settings/panel_spec.rb +++ b/spec/lib/sidebars/user_settings/panel_spec.rb @@ -10,6 +10,7 @@ RSpec.describe Sidebars::UserSettings::Panel, feature_category: :navigation do subject { described_class.new(context) } it_behaves_like 'a panel with uniquely identifiable menu items' + it_behaves_like 'a panel instantiable by the anonymous user' it 'implements #super_sidebar_context_header' do expect(subject.super_sidebar_context_header).to eq({ title: _('User settings'), avatar: user.avatar_url }) diff --git a/spec/lib/sidebars/your_work/panel_spec.rb b/spec/lib/sidebars/your_work/panel_spec.rb index 65c2786a16d..e2ca422359a 100644 --- a/spec/lib/sidebars/your_work/panel_spec.rb +++ b/spec/lib/sidebars/your_work/panel_spec.rb @@ -10,6 +10,7 @@ RSpec.describe Sidebars::YourWork::Panel, feature_category: :navigation do subject { described_class.new(context) } it_behaves_like 'a panel with uniquely identifiable menu items' + it_behaves_like 'a panel instantiable by the anonymous user' it 'implements #super_sidebar_context_header' do expect(subject.super_sidebar_context_header).to eq({ title: 'Your work', icon: 'work' }) |