BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
9dab1575
Commit
9dab1575
authored
Aug 04, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'tc-fix-mr-query-params' into 'master'
Add spec to test combining API merge_requests query parameters See merge request !11172
parents
5df9283f
e15d339a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
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 @
9dab1575
...
...
@@ -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