Commit 07016077 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Hide `new board`link when multiple issue boards isn't available

parent fd3c2b5c
...@@ -43,9 +43,11 @@ ...@@ -43,9 +43,11 @@
- if can?(current_user, :admin_board, @project) - if can?(current_user, :admin_board, @project)
.dropdown-footer{ "v-if" => "currentPage === ''" } .dropdown-footer{ "v-if" => "currentPage === ''" }
%ul.dropdown-footer-list %ul.dropdown-footer-list
- if @project.feature_available?(:multiple_issue_boards)
%li %li
%a{ "href" => "#", "@click.stop.prevent" => "showPage('new')" } %a{ "href" => "#", "@click.stop.prevent" => "showPage('new')" }
Create new board Create new board
%li %li
%a{ "href" => "#", "@click.stop.prevent" => "showPage('edit')" } %a{ "href" => "#", "@click.stop.prevent" => "showPage('edit')" }
Edit board name Edit board name
......
...@@ -7,11 +7,16 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -7,11 +7,16 @@ describe 'Multiple Issue Boards', feature: true, js: true do
let!(:board) { create(:board, project: project) } let!(:board) { create(:board, project: project) }
let!(:board2) { create(:board, project: project) } let!(:board2) { create(:board, project: project) }
context 'with multiple issue boards enabled' do
before do
stub_licensed_features(multiple_issue_boards: true)
end
context 'authorized user' do context 'authorized user' do
before do before do
project.team << [user, :master] project.team << [user, :master]
gitlab_sign_in(user) login_as(user)
visit project_boards_path(project) visit project_boards_path(project)
wait_for_requests wait_for_requests
...@@ -50,18 +55,16 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -50,18 +55,16 @@ describe 'Multiple Issue Boards', feature: true, js: true do
click_button board.name click_button board.name
page.within('.dropdown-menu') do page.within('.dropdown-menu') do
click_link 'Edit board name' click_link 'Create new board'
fill_in 'board-new-name', with: 'Testing' fill_in 'board-new-name', with: 'This is a new board'
click_button 'Save' click_button 'Create'
end end
wait_for_requests wait_for_requests
page.within('.dropdown-menu') do expect(page).to have_button('This is a new board')
expect(page).to have_content('Testing')
end
end end
it 'edits board name' do it 'edits board name' do
...@@ -158,4 +161,27 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -158,4 +161,27 @@ describe 'Multiple Issue Boards', feature: true, js: true do
end end
end end
end end
end
context 'with multiple issue boards disabled' do
before do
stub_licensed_features(multiple_issue_boards: false)
project.team << [user, :master]
login_as(user)
visit project_boards_path(project)
wait_for_requests
end
it 'hides the link to create a new board' do
click_button board.name
page.within('.dropdown-menu') do
expect(page).to have_content('Edit board name')
expect(page).not_to have_content('Create new board')
expect(page).to have_content('Delete board')
end
end
end
end end
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