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
a9da7e60
Commit
a9da7e60
authored
Dec 13, 2016
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'api-dont-allow-blank-mr-titles' into 'master'
Don't allow blank MR titles in API Closes #25033 See merge request !7848
parents
9a3c53fd
2cbd07e6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
merge_requests.rb
lib/api/merge_requests.rb
+2
-2
merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+16
-0
No files found.
lib/api/merge_requests.rb
View file @
a9da7e60
...
...
@@ -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 @
a9da7e60
...
...
@@ -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