Commit 13d89920 authored by Thong Kuah's avatar Thong Kuah

Merge branch 'rj-fix-spec' into 'master'

Use relative position to order issues

See merge request gitlab-org/gitlab-ce!30095
parents c95b671b 25b3d905
...@@ -102,14 +102,16 @@ describe 'Group issues page' do ...@@ -102,14 +102,16 @@ describe 'Group issues page' do
end end
context 'manual ordering' do context 'manual ordering' do
let(:user_in_group) { create(:group_member, :maintainer, user: create(:user), group: group ).user }
let!(:issue1) { create(:issue, project: project, title: 'Issue #1', relative_position: 1) }
let!(:issue2) { create(:issue, project: project, title: 'Issue #2', relative_position: 2) }
let!(:issue3) { create(:issue, project: project, title: 'Issue #3', relative_position: 3) }
before do before do
stub_feature_flags(manual_sorting: true) sign_in(user_in_group)
end end
let!(:issue1) { create(:issue, project: project, title: 'Issue #1') }
let!(:issue2) { create(:issue, project: project, title: 'Issue #2') }
let!(:issue3) { create(:issue, project: project, title: 'Issue #3') }
it 'displays all issues' do it 'displays all issues' do
visit issues_group_path(group, sort: 'relative_position') visit issues_group_path(group, sort: 'relative_position')
...@@ -136,14 +138,19 @@ describe 'Group issues page' do ...@@ -136,14 +138,19 @@ describe 'Group issues page' do
visit issues_group_path(group, sort: 'relative_position') visit issues_group_path(group, sort: 'relative_position')
drag_to(selector: '.manual-ordering', drag_to(selector: '.manual-ordering',
scrollable: '#board-app',
list_from_index: 0,
from_index: 0, from_index: 0,
to_index: 2, to_index: 2)
list_to_index: 0)
wait_for_requests wait_for_requests
check_issue_order
visit issues_group_path(group, sort: 'relative_position')
check_issue_order
end
def check_issue_order
page.within('.manual-ordering') do page.within('.manual-ordering') do
expect(find('.issue:nth-child(1) .title')).to have_content('Issue #2') expect(find('.issue:nth-child(1) .title')).to have_content('Issue #2')
expect(find('.issue:nth-child(2) .title')).to have_content('Issue #3') expect(find('.issue:nth-child(2) .title')).to have_content('Issue #3')
......
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