Resolve "Operations navigation menu renders empty menu when user does not have the right permissions"

This commit is contained in:
Lukas Eipert 2018-05-29 11:37:59 +00:00 committed by Dmitriy Zaporozhets
parent 7925127180
commit 7a0f15e2c6
2 changed files with 15 additions and 0 deletions

View File

@ -257,6 +257,9 @@ module ProjectsHelper
if project.builds_enabled? && can?(current_user, :read_pipeline, project)
nav_tabs << :pipelines
end
if can?(current_user, :read_environment, project) || can?(current_user, :read_cluster, project)
nav_tabs << :operations
end

View File

@ -44,6 +44,18 @@ describe 'Projects > User sees sidebar' do
expect(page).not_to have_content 'Repository'
expect(page).not_to have_content 'CI / CD'
expect(page).not_to have_content 'Merge Requests'
expect(page).not_to have_content 'Operations'
end
end
it 'shows build tab if builds are public' do
project.public_builds = true
project.save
visit project_path(project)
within('.nav-sidebar') do
expect(page).to have_content 'CI / CD'
end
end