diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-10-31 15:54:17 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2016-10-31 15:54:17 +0000 |
commit | a60cc42b262cb63ce5d2284f1f3f41d6521daa14 (patch) | |
tree | 31a86443d5345a3a9f63113d561faf3a86ce0299 | |
parent | 5566f277caffc6be3f5c7bfa8e8ab2fab2928ce9 (diff) | |
parent | cabc2a716035ef61bec661db44958ee2e48ea841 (diff) | |
download | gitlab-ce-a60cc42b262cb63ce5d2284f1f3f41d6521daa14.tar.gz |
Merge branch 'issue_23951' into 'master'
Fix builds tab visibility
closes #23951
See merge request !7178
-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 db780469f1d..c53bdd35a30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Please view this file on the master branch, on stable branches it's out of date. - Fix applying labels for GitHub-imported MRs !7139 - Fix importing MR comments from GitHub !7139 - Modify GitHub importer to be retryable !7003 + - Fix builds tab visibility - Fix and improve `Sortable.highest_label_priority` - Fixed sticky merge request tabs when sidebar is pinned 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 |