diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-10-31 15:54:17 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-11-04 18:24:22 +0100 |
commit | 54270ae2890cad83d0d9ddf8df2fb900bde62d4c (patch) | |
tree | cffb3039fed4e53cfabcd2a400012c19e72dbfe5 | |
parent | 44603ea9d90284d0a6b4046314a79b70997cc33a (diff) | |
download | gitlab-ce-54270ae2890cad83d0d9ddf8df2fb900bde62d4c.tar.gz |
Merge branch 'issue_23951' into 'master'
Fix builds tab visibility
closes #23951
See merge request !7178
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 6 | ||||
-rw-r--r-- | spec/features/projects/features_visibility_spec.rb | 16 |
3 files changed, 22 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2972716197e..2598b765840 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index d26b4018be6..42c00ec3cd5 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -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 diff --git a/spec/features/projects/features_visibility_spec.rb b/spec/features/projects/features_visibility_spec.rb index 1d4484a9edd..d25cf7fb353 100644 --- a/spec/features/projects/features_visibility_spec.rb +++ b/spec/features/projects/features_visibility_spec.rb @@ -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 |