summaryrefslogtreecommitdiff
path: root/spec/controllers/projects
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/projects')
-rw-r--r--spec/controllers/projects/issues_controller_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb
index 1fda9d63bbe..30228248baf 100644
--- a/spec/controllers/projects/issues_controller_spec.rb
+++ b/spec/controllers/projects/issues_controller_spec.rb
@@ -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 }