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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
a1ddf904
Commit
a1ddf904
authored
Mar 31, 2020
by
Michelle Gill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return error message for create_merge_request
parent
00c62397
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-1
changelogs/unreleased/merge-request-typo.yml
changelogs/unreleased/merge-request-typo.yml
+5
-0
spec/controllers/projects/issues_controller_spec.rb
spec/controllers/projects/issues_controller_spec.rb
+20
-0
No files found.
app/controllers/projects/issues_controller.rb
View file @
a1ddf904
...
...
@@ -186,7 +186,7 @@ class Projects::IssuesController < Projects::ApplicationController
if
result
[
:status
]
==
:success
render
json:
MergeRequestCreateSerializer
.
new
.
represent
(
result
[
:merge_request
])
else
render
json:
result
[
:mess
s
age
],
status: :unprocessable_entity
render
json:
result
[
:message
],
status: :unprocessable_entity
end
end
...
...
changelogs/unreleased/merge-request-typo.yml
0 → 100644
View file @
a1ddf904
---
title
:
Return error message for create_merge_request
merge_request
:
28482
author
:
type
:
fixed
spec/controllers/projects/issues_controller_spec.rb
View file @
a1ddf904
...
...
@@ -1249,6 +1249,26 @@ describe Projects::IssuesController do
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
context
'invalid branch name'
do
it
'is unprocessable'
do
post
(
:create_merge_request
,
params:
{
target_project_id:
nil
,
branch_name:
'master'
,
ref:
'master'
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
id:
issue
.
to_param
},
format: :json
)
expect
(
response
.
body
).
to
eq
(
'Branch already exists'
)
expect
(
response
).
to
have_gitlab_http_status
(
:unprocessable_entity
)
end
end
context
'target_project_id is set'
do
let
(
:target_project
)
{
fork_project
(
project
,
user
,
repository:
true
)
}
let
(
:target_project_id
)
{
target_project
.
id
}
...
...
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