diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/lib/sidebars/projects/panel_spec.rb | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/lib/sidebars/projects/panel_spec.rb')
-rw-r--r-- | spec/lib/sidebars/projects/panel_spec.rb | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/spec/lib/sidebars/projects/panel_spec.rb b/spec/lib/sidebars/projects/panel_spec.rb index 7e69a2dfe52..ff253eedd08 100644 --- a/spec/lib/sidebars/projects/panel_spec.rb +++ b/spec/lib/sidebars/projects/panel_spec.rb @@ -17,16 +17,40 @@ RSpec.describe Sidebars::Projects::Panel do subject { described_class.new(context).instance_variable_get(:@menus) } context 'when integration is present and active' do - let_it_be(:confluence) { create(:confluence_integration, active: true) } + context 'confluence only' do + let_it_be(:confluence) { create(:confluence_integration, active: true) } - let(:project) { confluence.project } + let(:project) { confluence.project } - it 'contains Confluence menu item' do - expect(subject.index { |i| i.is_a?(Sidebars::Projects::Menus::ConfluenceMenu) }).not_to be_nil + it 'contains Confluence menu item' do + expect(subject.index { |i| i.is_a?(Sidebars::Projects::Menus::ConfluenceMenu) }).not_to be_nil + end + + it 'does not contain Wiki menu item' do + expect(subject.index { |i| i.is_a?(Sidebars::Projects::Menus::WikiMenu) }).to be_nil + end end - it 'does not contain Wiki menu item' do - expect(subject.index { |i| i.is_a?(Sidebars::Projects::Menus::WikiMenu) }).to be_nil + context 'shimo only' do + let_it_be(:shimo) { create(:shimo_integration, active: true) } + + let(:project) { shimo.project } + + it 'contains Shimo menu item' do + expect(subject.index { |i| i.is_a?(Sidebars::Projects::Menus::ShimoMenu) }).not_to be_nil + end + end + + context 'confluence & shimo' do + let_it_be(:confluence) { create(:confluence_integration, active: true) } + let_it_be(:shimo) { create(:shimo_integration, active: true) } + + let(:project) { confluence.project } + + it 'contains Confluence menu item, not Shimo' do + expect(subject.index { |i| i.is_a?(Sidebars::Projects::Menus::ConfluenceMenu) }).not_to be_nil + expect(subject.index { |i| i.is_a?(Sidebars::Projects::Menus::ShimoMenu) }).to be_nil + end end end |