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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
070a3079
Commit
070a3079
authored
Feb 02, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a spec for the API pagination Link header
parent
c41a8be8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+3
-3
No files found.
spec/requests/api/issues_spec.rb
View file @
070a3079
...
...
@@ -46,10 +46,10 @@ describe API::API, api: true do
expect
(
json_response
.
first
[
'title'
]).
to
eq
(
issue
.
title
)
end
it
"should add pagination headers"
do
get
api
(
"/issues?per_page=3"
,
user
)
it
"should add pagination headers
and keep query params
"
do
get
api
(
"/issues?
state=closed&
per_page=3"
,
user
)
expect
(
response
.
headers
[
'Link'
]).
to
eq
(
'<http://www.example.com/api/v3/issues?page=1&per_page=3
>; rel="first", <http://www.example.com/api/v3/issues?page=1&per_page=3>; rel="last"'
'<http://www.example.com/api/v3/issues?page=1&per_page=3
&private_token=%s&state=closed>; rel="first", <http://www.example.com/api/v3/issues?page=1&per_page=3&private_token=%s&state=closed>; rel="last"'
%
[
user
.
private_token
,
user
.
private_token
]
)
end
...
...
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