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
e15d339a
Commit
e15d339a
authored
May 08, 2017
by
Toon Claes
Committed by
Toon Claes
Aug 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec to test combining API merge_requests query parameters
To investigate gitlab-org/gitlab-ce#31599
parent
c39daf93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+20
-0
No files found.
spec/requests/api/merge_requests_spec.rb
View file @
e15d339a
...
...
@@ -293,6 +293,26 @@ describe API::MergeRequests do
expect
(
json_response
.
length
).
to
eq
(
0
)
end
it
'returns an array of labeled merge requests that are merged for a milestone'
do
bug_label
=
create
(
:label
,
title:
'bug'
,
color:
'#FFAABB'
,
project:
project
)
mr1
=
create
(
:merge_request
,
state:
"merged"
,
source_project:
project
,
target_project:
project
,
milestone:
milestone
)
mr2
=
create
(
:merge_request
,
state:
"merged"
,
source_project:
project
,
target_project:
project
,
milestone:
milestone1
)
mr3
=
create
(
:merge_request
,
state:
"closed"
,
source_project:
project
,
target_project:
project
,
milestone:
milestone1
)
_mr
=
create
(
:merge_request
,
state:
"merged"
,
source_project:
project
,
target_project:
project
,
milestone:
milestone1
)
create
(
:label_link
,
label:
bug_label
,
target:
mr1
)
create
(
:label_link
,
label:
bug_label
,
target:
mr2
)
create
(
:label_link
,
label:
bug_label
,
target:
mr3
)
get
api
(
"/projects/
#{
project
.
id
}
/merge_requests?labels=
#{
bug_label
.
title
}
&milestone=
#{
milestone1
.
title
}
&state=merged"
,
user
)
expect
(
response
).
to
have_http_status
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
.
length
).
to
eq
(
1
)
expect
(
json_response
.
first
[
'id'
]).
to
eq
(
mr2
.
id
)
end
context
"with ordering"
do
before
do
@mr_later
=
mr_with_later_created_and_updated_at_time
...
...
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