diff options
author | Valery Sizov <valery@gitlab.com> | 2017-03-07 20:57:24 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2017-03-07 22:02:08 +0300 |
commit | 9895d6707d51140b3cc75e925cfd775c6bd93f83 (patch) | |
tree | 9b9903dd2e1130128f2708a32dc25f6828a71b37 /spec/services/boards | |
parent | 1497db75f5f4850f51082de326fa0b4d8574bf3b (diff) |
[Issue Board Sorting] More accurate move through the list
Diffstat (limited to 'spec/services/boards')
-rw-r--r-- | spec/services/boards/issues/move_service_spec.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/services/boards/issues/move_service_spec.rb b/spec/services/boards/issues/move_service_spec.rb index 6c9709c808e..727ea04ea5c 100644 --- a/spec/services/boards/issues/move_service_spec.rb +++ b/spec/services/boards/issues/move_service_spec.rb @@ -78,10 +78,10 @@ describe Boards::Issues::MoveService, services: true do end context 'when moving to same list' do - let(:issue) { create(:labeled_issue, project: project, labels: [bug, development]) } + 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 } } + let(:params) { { board_id: board1.id, from_list_id: list1.id, to_list_id: list1.id } } it 'returns false' do expect(described_class.new(project, user, params).execute(issue)).to eq false @@ -94,13 +94,13 @@ describe Boards::Issues::MoveService, services: true do end it 'sorts issues' do - [issue1, issue2].each(&:move_to_end) - - issue.move_between!(issue1, issue2) + [issue, issue1, issue2].each do |issue| + issue.move_to_end && issue.save! + end - params.merge!(move_after_iid: issue.iid, move_before_iid: issue2.iid) + params.merge!(move_after_iid: issue1.iid, move_before_iid: issue2.iid) - described_class.new(project, user, params).execute(issue1) + described_class.new(project, user, params).execute(issue) expect(issue.relative_position).to be_between(issue1.relative_position, issue2.relative_position) end |