BigW Consortium Gitlab

Commit ad56ae0d by Rémy Coutable

Merge branch '35253-desc-protected-branches-for-non-member' into 'master'

Hide description about protected branches to non-member Closes #35253 See merge request !12945
parents 1540cc43 1ec51361
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
%div{ class: container_class } %div{ class: container_class }
.top-area.adjust .top-area.adjust
.nav-text - if can?(current_user, :admin_project, @project)
Protected branches can be managed in .nav-text
= link_to 'project settings', project_protected_branches_path(@project) Protected branches can be managed in
= link_to 'project settings', project_protected_branches_path(@project)
.nav-controls .nav-controls
= form_tag(filter_branches_path, method: :get) do = form_tag(filter_branches_path, method: :get) do
......
---
title: Hide description about protected branches to non-member
merge_request: 12945
author: Takuya Noguchi
...@@ -24,7 +24,6 @@ describe 'Branches', feature: true do ...@@ -24,7 +24,6 @@ describe 'Branches', feature: true do
repository.branches_sorted_by(:name).first(20).each do |branch| repository.branches_sorted_by(:name).first(20).each do |branch|
expect(page).to have_content("#{branch.name}") expect(page).to have_content("#{branch.name}")
end end
expect(page).to have_content("Protected branches can be managed in project settings")
end end
it 'sorts the branches by name' do it 'sorts the branches by name' do
...@@ -130,6 +129,14 @@ describe 'Branches', feature: true do ...@@ -130,6 +129,14 @@ describe 'Branches', feature: true do
project.team << [user, :master] project.team << [user, :master]
end end
describe 'Initial branches page' do
it 'shows description for admin' do
visit project_branches_path(project)
expect(page).to have_content("Protected branches can be managed in project settings")
end
end
describe 'Delete protected branch' do describe 'Delete protected branch' do
before do before do
visit project_protected_branches_path(project) visit project_protected_branches_path(project)
......
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