diff options
Diffstat (limited to 'spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb')
-rw-r--r-- | spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb b/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb index 881ea818cb0..bf0bf63e164 100644 --- a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb +++ b/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'layouts/nav/sidebar/_project' do +RSpec.describe 'layouts/nav/sidebar/_project' do let(:project) { create(:project, :repository) } before do @@ -76,7 +76,7 @@ describe 'layouts/nav/sidebar/_project' do it 'does not show the wiki tab' do render - expect(rendered).not_to have_link('Wiki', href: wiki_path(project.wiki)) + expect(rendered).not_to have_link('Wiki') end end end @@ -109,6 +109,38 @@ describe 'layouts/nav/sidebar/_project' do end end + describe 'confluence tab' do + let!(:service) { create(:confluence_service, project: project, active: active) } + + before do + render + end + + context 'when the Confluence integration is active' do + let(:active) { true } + + it 'shows the Confluence tab' do + expect(rendered).to have_link('Confluence', href: project_wikis_confluence_path(project)) + end + + it 'does not show the GitLab wiki tab' do + expect(rendered).not_to have_link('Wiki') + end + end + + context 'when it is disabled' do + let(:active) { false } + + it 'does not show the Confluence tab' do + expect(rendered).not_to have_link('Confluence') + end + + it 'shows the GitLab wiki tab' do + expect(rendered).to have_link('Wiki', href: wiki_path(project.wiki)) + end + end + end + describe 'ci/cd settings tab' do before do project.update!(archived: project_archived) |