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/issues | |
parent | c401088bc7a1e560023b7eb6ebfffb65d51c641c (diff) | |
download | gitlab-ce-800f2a722f2aac42aee85fde44311b201eaa9589.tar.gz |
[Issue board sorting] Specs
Diffstat (limited to 'spec/services/issues')
-rw-r--r-- | spec/services/issues/update_service_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index d83b09fd32c..f552252da48 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -58,6 +58,22 @@ describe Issues::UpdateService, services: true do expect(issue.due_date).to eq Date.tomorrow end + it 'sorts issues as specified by parameters' do + issue1 = create :issue, project: project, assignee_id: user3.id + issue2 = create :issue, project: project, assignee_id: user3.id + + [issue, issue1, issue2].each do |issue| + issue.move_to_end + issue.save + end + + opts.merge! move_between_iids: [issue1.iid, issue2.iid] + + update_issue(opts) + + expect(issue.relative_position).to be_between(issue1.relative_position, issue2.relative_position) + end + context 'when current user cannot admin issues in the project' do let(:guest) { create(:user) } before do |