Commit 353ddbc7 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'stanhu/gitlab-ce-fix-api-mr-comment-notifications'

......@@ -5,6 +5,7 @@ v 8.1.0 (unreleased)
- Speed up load times of issue detail pages by roughly 1.5x
- Make diff file view easier to use on mobile screens (Stan Hu)
- Improved performance of finding users by username or Email address
- Fix bug where merge request comments created by API would not trigger notifications (Stan Hu)
- Add support for creating directories from Files page (Stan Hu)
- Allow removing of project without confirmation when JavaScript is disabled (Stan Hu)
- Support filtering by "Any" milestone or issue and fix "No Milestone" and "No Label" filters (Stan Hu)
......@@ -249,8 +249,16 @@ def handle_merge_request_errors!(errors)
required_attributes! [:note]
merge_request = user_project.merge_requests.find(params[:merge_request_id])
note = params[:note], project_id: = current_user
authorize! :create_note, merge_request
opts = {
note: params[:note],
noteable_type: 'MergeRequest',
note =, current_user, opts).execute
present note, with: Entities::MRNote
......@@ -379,9 +379,14 @@
describe "POST /projects/:id/merge_request/:merge_request_id/comments" do
it "should return comment" do
original_count = merge_request.notes.size
post api("/projects/#{}/merge_request/#{}/comments", user), note: "My comment"
expect(response.status).to eq(201)
expect(json_response['note']).to eq('My comment')
expect(json_response['author']['name']).to eq(
expect(json_response['author']['username']).to eq(user.username)
expect(merge_request.notes.size).to eq(original_count + 1)
it "should return 400 if note is missing" do
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment