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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
7660e320
Commit
7660e320
authored
Dec 28, 2019
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust api specs for last page link
parent
751fba23
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+16
-1
No files found.
spec/requests/api/projects_spec.rb
View file @
7660e320
...
@@ -594,12 +594,27 @@ describe API::Projects do
...
@@ -594,12 +594,27 @@ describe API::Projects do
expect
(
json_response
.
map
{
|
p
|
p
[
'id'
]
}).
to
contain_exactly
(
public_project
.
id
)
expect
(
json_response
.
map
{
|
p
|
p
[
'id'
]
}).
to
contain_exactly
(
public_project
.
id
)
end
end
it
'
does not include a link if the end has reached and there is no more data
'
do
it
'
still includes a link if the end has reached and there is no more data after this page
'
do
get
api
(
'/projects'
,
current_user
),
params:
params
.
merge
(
id_after:
project2
.
id
)
get
api
(
'/projects'
,
current_user
),
params:
params
.
merge
(
id_after:
project2
.
id
)
expect
(
response
.
header
).
to
include
(
'Links'
)
expect
(
response
.
header
[
'Links'
]).
to
include
(
'pagination=keyset'
)
expect
(
response
.
header
[
'Links'
]).
to
include
(
"id_after=
#{
project3
.
id
}
"
)
end
it
'does not include a next link when the page does not have any records'
do
get
api
(
'/projects'
,
current_user
),
params:
params
.
merge
(
id_after:
Project
.
maximum
(
:id
))
expect
(
response
.
header
).
not_to
include
(
'Links'
)
expect
(
response
.
header
).
not_to
include
(
'Links'
)
end
end
it
'returns an empty array when the page does not have any records'
do
get
api
(
'/projects'
,
current_user
),
params:
params
.
merge
(
id_after:
Project
.
maximum
(
:id
))
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
).
to
eq
([])
end
it
'responds with 501 if order_by is different from id'
do
it
'responds with 501 if order_by is different from id'
do
get
api
(
'/projects'
,
current_user
),
params:
params
.
merge
(
order_by: :created_at
)
get
api
(
'/projects'
,
current_user
),
params:
params
.
merge
(
order_by: :created_at
)
...
...
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