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
Jérome Perrin
gitlab-ce
Commits
2cbd07e6
Commit
2cbd07e6
authored
Nov 30, 2016
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't allow blank MR titles in API
parent
db9e1635
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+2
-2
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+16
-0
No files found.
lib/api/merge_requests.rb
View file @
2cbd07e6
...
...
@@ -143,8 +143,8 @@ module API
success
Entities
::
MergeRequest
end
params
do
optional
:title
,
type:
String
,
desc:
'The title of the merge request'
optional
:target_branch
,
type:
String
,
desc:
'The target branch'
optional
:title
,
type:
String
,
allow_blank:
false
,
desc:
'The title of the merge request'
optional
:target_branch
,
type:
String
,
allow_blank:
false
,
desc:
'The target branch'
optional
:state_event
,
type:
String
,
values:
%w[close reopen merge]
,
desc:
'Status of the merge request'
use
:optional_params
...
...
spec/requests/api/merge_requests_spec.rb
View file @
2cbd07e6
...
...
@@ -533,6 +533,22 @@ describe API::MergeRequests, api: true do
expect
(
json_response
[
'labels'
]).
to
include
'?'
expect
(
json_response
[
'labels'
]).
to
include
'&'
end
it
'does not update state when title is empty'
do
put
api
(
"/projects/
#{
project
.
id
}
/merge_requests/
#{
merge_request
.
id
}
"
,
user
),
state_event:
'close'
,
title:
nil
merge_request
.
reload
expect
(
response
).
to
have_http_status
(
400
)
expect
(
merge_request
.
state
).
to
eq
(
'opened'
)
end
it
'does not update state when target_branch is empty'
do
put
api
(
"/projects/
#{
project
.
id
}
/merge_requests/
#{
merge_request
.
id
}
"
,
user
),
state_event:
'close'
,
target_branch:
nil
merge_request
.
reload
expect
(
response
).
to
have_http_status
(
400
)
expect
(
merge_request
.
state
).
to
eq
(
'opened'
)
end
end
describe
"POST /projects/:id/merge_requests/:merge_request_id/comments"
do
...
...
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