diff options
author | Valery Sizov <valery@gitlab.com> | 2017-02-27 17:45:55 +0200 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2017-02-28 16:52:49 +0200 |
commit | 800f2a722f2aac42aee85fde44311b201eaa9589 (patch) | |
tree | 177a88e733948b761a03c8c456586f2442b97d09 /spec/services/boards | |
parent | c401088bc7a1e560023b7eb6ebfffb65d51c641c (diff) | |
download | gitlab-ce-800f2a722f2aac42aee85fde44311b201eaa9589.tar.gz |
[Issue board sorting] Specs
Diffstat (limited to 'spec/services/boards')
-rw-r--r-- | spec/services/boards/issues/move_service_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/services/boards/issues/move_service_spec.rb b/spec/services/boards/issues/move_service_spec.rb index 77f75167b3d..5b71762e2b3 100644 --- a/spec/services/boards/issues/move_service_spec.rb +++ b/spec/services/boards/issues/move_service_spec.rb @@ -79,6 +79,8 @@ describe Boards::Issues::MoveService, services: true do context 'when moving to same list' do let(:issue) { create(:labeled_issue, project: project, labels: [bug, development]) } + let(:issue1) { create(:labeled_issue, project: project, labels: [bug, development]) } + let(:issue2) { create(:labeled_issue, project: project, labels: [bug, development]) } let(:params) { { board_id: board1.id, from_list_id: list1.id, to_list_id: list1.id } } it 'returns false' do @@ -90,6 +92,16 @@ describe Boards::Issues::MoveService, services: true do expect(issue.reload.labels).to contain_exactly(bug, development) end + + it 'sorts issues' do + issue.move_between(issue1, issue2) + + params.merge! move_after_iid: issue1.iid, move_before_iid: issue2.iid + + described_class.new(project, user, params).execute(issue1) + + expect(issue1.relative_position).to be_between(issue.relative_position, issue2.relative_position) + end end end end |