Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
c8352c9f
Commit
c8352c9f
authored
Feb 16, 2019
by
Nermin Vehabovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added: Specs for issues index
parent
b2a132dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
+31
-3
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+31
-3
No files found.
spec/requests/api/issues_spec.rb
View file @
c8352c9f
...
...
@@ -359,12 +359,40 @@ describe API::Issues do
expect_paginated_array_response
([])
end
context
'without sort params'
do
it
'sorts by created_at descending by default'
do
get
api
(
'/issues'
,
user
)
expect_paginated_array_response
([
issue
.
id
,
closed_issue
.
id
])
end
context
'with 2 issues with same created_at'
do
let!
(
:closed_issue2
)
do
create
:closed_issue
,
author:
user
,
assignees:
[
user
],
project:
project
,
milestone:
milestone
,
created_at:
closed_issue
.
created_at
,
updated_at:
1
.
hour
.
ago
,
title:
issue_title
,
description:
issue_description
end
it
'page breaks first page correctly'
do
get
api
(
'/issues?per_page=2'
,
user
)
expect_paginated_array_response
([
issue
.
id
,
closed_issue2
.
id
])
end
it
'page breaks second page correctly'
do
get
api
(
'/issues?per_page=2&page=2'
,
user
)
expect_paginated_array_response
([
closed_issue
.
id
])
end
end
end
it
'sorts ascending when requested'
do
get
api
(
'/issues?sort=asc'
,
user
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment