Commit 54270ae2 authored by Sean McGivern's avatar Sean McGivern Committed by Rémy Coutable

Merge branch 'issue_23951' into 'master'

Fix builds tab visibility

closes #23951

See merge request !7178
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 44603ea9
......@@ -6,6 +6,7 @@ Please view this file on the master branch, on stable branches it's out of date.
- Disable reference Markdown for unavailable features.
- Allow owners to fetch source code in CI builds. !6943
- Reduce the overhead to calculate number of open/closed issues and merge requests within the group or project. !7123
- Fix builds tab visibility. !7178
## 8.13.3 (2016-11-02)
......
......@@ -174,10 +174,14 @@ module ProjectsHelper
nav_tabs << :merge_requests
end
if can?(current_user, :read_build, project)
if can?(current_user, :read_pipeline, project)
nav_tabs << :pipelines
end
if can?(current_user, :read_build, project)
nav_tabs << :builds
end
if Gitlab.config.registry.enabled && can?(current_user, :read_container_image, project)
nav_tabs << :container_registry
end
......
......@@ -41,6 +41,22 @@ describe 'Edit Project Settings', feature: true do
end
end
end
context "pipelines subtabs" do
it "shows builds when enabled" do
visit namespace_project_pipelines_path(project.namespace, project)
expect(page).to have_selector(".shortcuts-builds")
end
it "hides builds when disabled" do
allow(Ability).to receive(:allowed?).with(member, :read_builds, project).and_return(false)
visit namespace_project_pipelines_path(project.namespace, project)
expect(page).not_to have_selector(".shortcuts-builds")
end
end
end
describe 'project features visibility pages' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment