Commit 3a4b3a19 authored by Phil Hughes's avatar Phil Hughes

fixed issue_ordering_spec

parent 8c3f65f8
......@@ -25,11 +25,11 @@ describe 'Issue Boards', :feature, :js do
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
expect(page).to have_selector('.board', count: 2)
expect(page).to have_selector('.board', count: 3)
end
it 'has un-ordered issue as last issue' do
page.within(first('.board')) do
page.within(find('.board:nth-child(2)')) do
expect(all('.card').last).to have_content(issue4.title)
end
end
......@@ -39,7 +39,7 @@ describe 'Issue Boards', :feature, :js do
wait_for_requests
page.within(first('.board')) do
page.within(find('.board:nth-child(2)')) do
expect(first('.card')).to have_content(issue4.title)
end
end
......@@ -50,7 +50,7 @@ describe 'Issue Boards', :feature, :js do
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
expect(page).to have_selector('.board', count: 2)
expect(page).to have_selector('.board', count: 3)
end
it 'moves from middle to top' do
......@@ -113,50 +113,50 @@ describe 'Issue Boards', :feature, :js do
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
expect(page).to have_selector('.board', count: 3)
expect(page).to have_selector('.board', count: 4)
end
it 'moves to top of another list' do
drag(list_from_index: 0, list_to_index: 1)
drag(list_from_index: 1, list_to_index: 2)
wait_for_requests
expect(first('.board')).to have_selector('.card', count: 2)
expect(all('.board')[1]).to have_selector('.card', count: 4)
expect(find('.board:nth-child(2)')).to have_selector('.card', count: 2)
expect(all('.board')[2]).to have_selector('.card', count: 4)
page.within(all('.board')[1]) do
page.within(all('.board')[2]) do
expect(first('.card')).to have_content(issue3.title)
end
end
it 'moves to bottom of another list' do
drag(list_from_index: 0, list_to_index: 1, to_index: 2)
drag(list_from_index: 1, list_to_index: 2, to_index: 2)
wait_for_requests
expect(first('.board')).to have_selector('.card', count: 2)
expect(all('.board')[1]).to have_selector('.card', count: 4)
expect(find('.board:nth-child(2)')).to have_selector('.card', count: 2)
expect(all('.board')[2]).to have_selector('.card', count: 4)
page.within(all('.board')[1]) do
page.within(all('.board')[2]) do
expect(all('.card').last).to have_content(issue3.title)
end
end
it 'moves to index of another list' do
drag(list_from_index: 0, list_to_index: 1, to_index: 1)
drag(list_from_index: 1, list_to_index: 2, to_index: 1)
wait_for_requests
expect(first('.board')).to have_selector('.card', count: 2)
expect(all('.board')[1]).to have_selector('.card', count: 4)
expect(find('.board:nth-child(2)')).to have_selector('.card', count: 2)
expect(all('.board')[2]).to have_selector('.card', count: 4)
page.within(all('.board')[1]) do
page.within(all('.board')[2]) do
expect(all('.card')[1]).to have_content(issue3.title)
end
end
end
def drag(selector: '.board-list', list_from_index: 0, from_index: 0, to_index: 0, list_to_index: 0)
def drag(selector: '.board-list', list_from_index: 1, from_index: 0, to_index: 0, list_to_index: 1)
drag_to(selector: selector,
scrollable: '#board-app',
list_from_index: list_from_index,
......
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