diff options
author | Valery Sizov <valery@gitlab.com> | 2017-03-07 19:04:44 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2017-03-14 19:13:52 +0300 |
commit | 29e34c332687be9456578a9b5f60adb10f4e10b5 (patch) | |
tree | 6704de41870b61b493bff7abd52e62be6b01cd3b /spec/services/boards | |
parent | 8f66751179bf97d92fa0b9e85fd5336b40f990ea (diff) |
Preserve order by priority on issues board
Diffstat (limited to 'spec/services/boards')
-rw-r--r-- | spec/services/boards/issues/list_service_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/services/boards/issues/list_service_spec.rb b/spec/services/boards/issues/list_service_spec.rb index 01baedc4761..22115c6566d 100644 --- a/spec/services/boards/issues/list_service_spec.rb +++ b/spec/services/boards/issues/list_service_spec.rb @@ -43,6 +43,32 @@ describe Boards::Issues::ListService, services: true do described_class.new(project, user, params).execute end + context 'issues are ordered by priority' do + it 'returns opened issues when list_id is missing' do + params = { board_id: board.id } + + issues = described_class.new(project, user, params).execute + + expect(issues).to eq [opened_issue2, reopened_issue1, opened_issue1] + end + + it 'returns closed issues when listing issues from Done' do + params = { board_id: board.id, id: done.id } + + issues = described_class.new(project, user, params).execute + + expect(issues).to eq [closed_issue4, closed_issue2, closed_issue3, closed_issue1] + end + + it 'returns opened issues that have label list applied when listing issues from a label list' do + params = { board_id: board.id, id: list1.id } + + issues = described_class.new(project, user, params).execute + + expect(issues).to eq [list1_issue3, list1_issue1, list1_issue2] + end + end + context 'with list that does not belong to the board' do it 'raises an error' do list = create(:list) |