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
b467dca4
Commit
b467dca4
authored
Feb 16, 2019
by
Nermin Vehabovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added: Specs for sort page break tie in the merge request list API
parent
eccfab44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
spec/support/shared_examples/requests/api/merge_requests_list.rb
...pport/shared_examples/requests/api/merge_requests_list.rb
+32
-0
No files found.
spec/support/shared_examples/requests/api/merge_requests_list.rb
View file @
b467dca4
...
...
@@ -257,6 +257,38 @@ shared_examples 'merge requests list' do
expect
(
response_dates
).
to
eq
(
response_dates
.
sort
.
reverse
)
end
context
'2 merge requests with equal created_at'
do
let!
(
:closed_mr2
)
do
create
:merge_request
,
state:
'closed'
,
milestone:
milestone1
,
author:
user
,
assignee:
user
,
source_project:
project
,
target_project:
project
,
title:
"Test"
,
created_at:
@mr_earlier
.
created_at
end
it
'page breaks first page correctly'
do
get
api
(
"
#{
endpoint_path
}
?sort=desc&per_page=4"
,
user
)
response_ids
=
json_response
.
map
{
|
merge_request
|
merge_request
[
'id'
]
}
expect
(
response_ids
).
to
include
(
closed_mr2
.
id
)
expect
(
response_ids
).
not_to
include
(
@mr_earlier
.
id
)
end
it
'page breaks second page correctly'
do
get
api
(
"
#{
endpoint_path
}
?sort=desc&per_page=4&page=2"
,
user
)
response_ids
=
json_response
.
map
{
|
merge_request
|
merge_request
[
'id'
]
}
expect
(
response_ids
).
not_to
include
(
closed_mr2
.
id
)
expect
(
response_ids
).
to
include
(
@mr_earlier
.
id
)
end
end
it
'returns an array of merge_requests ordered by updated_at'
do
path
=
endpoint_path
+
'?order_by=updated_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