diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-01-27 16:21:11 -0200 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-02-03 17:02:44 +0300 |
commit | 274987d5c0f7b04a9b7510c318c8df6dfab477df (patch) | |
tree | 965fd6bb67839793d6c7757a74d1290a6bc0f89d /spec/services/boards | |
parent | 7f58fc0e997a6784d978396747f39ce573dfe289 (diff) | |
download | gitlab-ce-274987d5c0f7b04a9b7510c318c8df6dfab477df.tar.gz |
Reuse endpoint to list issues for a list instead of create a new one
Diffstat (limited to 'spec/services/boards')
-rw-r--r-- | spec/services/boards/issues/list_service_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/services/boards/issues/list_service_spec.rb b/spec/services/boards/issues/list_service_spec.rb index 5d53c54254c..305278843f5 100644 --- a/spec/services/boards/issues/list_service_spec.rb +++ b/spec/services/boards/issues/list_service_spec.rb @@ -17,6 +17,10 @@ describe Boards::Issues::ListService, services: true do let!(:list2) { create(:list, board: board, label: testing, position: 1) } let!(:done) { create(:done_list, board: board) } + let!(:opened_issue1) { create(:labeled_issue, project: project, labels: [bug]) } + let!(:opened_issue2) { create(:labeled_issue, project: project, labels: [p2]) } + let!(:reopened_issue1) { create(:issue, :reopened, project: project) } + let!(:list1_issue1) { create(:labeled_issue, project: project, labels: [p2, development]) } let!(:list1_issue2) { create(:labeled_issue, project: project, labels: [development]) } let!(:list1_issue3) { create(:labeled_issue, project: project, labels: [development, p1]) } @@ -40,6 +44,14 @@ describe Boards::Issues::ListService, services: true do end context 'sets default order to 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 } |