Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2017-02-27 18:45:55 +0300
committerValery Sizov <valery@gitlab.com>2017-02-28 17:52:49 +0300
commit800f2a722f2aac42aee85fde44311b201eaa9589 (patch)
tree177a88e733948b761a03c8c456586f2442b97d09 /spec/services/boards
parentc401088bc7a1e560023b7eb6ebfffb65d51c641c (diff)
[Issue board sorting] Specs
Diffstat (limited to 'spec/services/boards')
-rw-r--r--spec/services/boards/issues/move_service_spec.rb12
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