Commit 098d461c authored by Phil Hughes's avatar Phil Hughes Committed by Douglas Barbosa Alexandre

More tests

Redirects back to issue boards index after deleting
parent 4fb94a83
......@@ -59,7 +59,7 @@ class Projects::BoardsController < Projects::ApplicationController
service = ::Boards::DestroyService.new(project, current_user)
if service.execute(@board)
head :ok
redirect_to namespace_project_boards_path(@project.namespace, @project)
else
head :unprocessable_entity
end
......
......@@ -6,6 +6,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
let(:user) { create(:user) }
let(:project) { create(:empty_project, :public) }
let!(:planning) { create(:label, project: project, name: 'Planning') }
let!(:board) { create(:board, project: project) }
let!(:board2) { create(:board, project: project) }
......@@ -47,6 +48,24 @@ describe 'Multiple Issue Boards', feature: true, js: true do
end
end
it 'creates new board' do
click_button board.name
page.within('.boards-title-holder .dropdown-menu') do
click_link 'Edit board name'
fill_in 'board-new-name', with: 'Testing'
click_button 'Save'
end
wait_for_vue_resource
page.within('.boards-title-holder .dropdown-menu') do
expect(page).to have_content('Testing')
end
end
it 'edits board name' do
click_button board.name
......@@ -80,11 +99,47 @@ describe 'Multiple Issue Boards', feature: true, js: true do
click_link 'Delete'
end
click_button board.name
click_button board2.name
page.within('.boards-title-holder .dropdown-menu') do
expect(page).not_to have_content(board.name)
expect(page).to have_content(board2.name)
end
end
it 'adds a list to the none default board' do
click_button board.name
page.within('.boards-title-holder .dropdown-menu') do
click_link board2.name
end
wait_for_vue_resource
page.within('.boards-switcher') do
expect(page).to have_content(board2.name)
end
click_button 'Create new list'
wait_for_ajax
page.within '.dropdown-menu-issues-board-new' do
click_link planning.title
end
wait_for_vue_resource
expect(page).to have_selector('.board', count: 3)
click_button board2.name
page.within('.boards-title-holder .dropdown-menu') do
click_link board.name
end
wait_for_vue_resource
expect(page).to have_selector('.board', count: 2)
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