diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb
index f19f143816f1e1aeb69189c347d3d8e50aae52db..1e17dd586c73ca442bacb9fae8240df637ddbd78 100644
--- a/app/controllers/projects/branches_controller.rb
+++ b/app/controllers/projects/branches_controller.rb
@@ -98,7 +98,7 @@ def create
if success
render json: { name: branch_name, url: project_tree_url(@project, branch_name) }
else
- render json: result[:messsage], status: :unprocessable_entity
+ render json: result[:message], status: :unprocessable_entity
end
end
end
diff --git a/spec/controllers/projects/branches_controller_spec.rb b/spec/controllers/projects/branches_controller_spec.rb
index 55c148bb66feff4b9153ec79c355e681f705cd65..600f8047a1df87f2bdb83aba0585162c9c0e0ea2 100644
--- a/spec/controllers/projects/branches_controller_spec.rb
+++ b/spec/controllers/projects/branches_controller_spec.rb
@@ -277,6 +277,7 @@ def create_branch_with_confidential_issue_project
create_branch name: "", ref: ""
expect(response).to have_gitlab_http_status(:unprocessable_entity)
+ expect(response.body).to include 'Failed to create branch'
end
end