diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-11 15:09:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-11 15:09:26 +0300 |
commit | c9687bdf58e9d4a9c3942f587bd4841f42e3b5de (patch) | |
tree | a60a2e20f152483be6a92bacdf10564bbc96c664 /spec/controllers/boards/issues_controller_spec.rb | |
parent | 3f3e4bcc50a3280d03299c2c263eafd9c8e3bd7b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/boards/issues_controller_spec.rb')
-rw-r--r-- | spec/controllers/boards/issues_controller_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/controllers/boards/issues_controller_spec.rb b/spec/controllers/boards/issues_controller_spec.rb index 605fff60c31..41c37cb84e5 100644 --- a/spec/controllers/boards/issues_controller_spec.rb +++ b/spec/controllers/boards/issues_controller_spec.rb @@ -57,6 +57,18 @@ describe Boards::IssuesController do expect(development.issues.map(&:relative_position)).not_to include(nil) end + it 'returns issues by closed_at in descending order in closed list' do + create(:closed_issue, project: project, title: 'New Issue 1', closed_at: 1.day.ago) + create(:closed_issue, project: project, title: 'New Issue 2', closed_at: 1.week.ago) + + list_issues user: user, board: board, list: board.lists.last.id + + expect(response).to have_gitlab_http_status(:ok) + expect(json_response['issues'].length).to eq(2) + expect(json_response['issues'][0]['title']).to eq('New Issue 1') + expect(json_response['issues'][1]['title']).to eq('New Issue 2') + end + it 'avoids N+1 database queries' do create(:labeled_issue, project: project, labels: [development]) control_count = ActiveRecord::QueryRecorder.new { list_issues(user: user, board: board, list: list2) }.count |