summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/api/merge_requests.rb2
-rw-r--r--spec/mailers/notify_spec.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb
index 234a005a998..d5595d5f16b 100644
--- a/lib/api/merge_requests.rb
+++ b/lib/api/merge_requests.rb
@@ -94,6 +94,8 @@ module Gitlab
authorize! :modify_merge_request, merge_request
+ MergeRequestObserver.current_user = current_user
+
if merge_request.update_attributes attrs
merge_request.reload_code
merge_request.mark_as_unchecked
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 7867c4dd78e..472458e8691 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -107,7 +107,7 @@ describe Notify do
let(:issue) { create(:issue, assignee: assignee, project: project ) }
describe 'that are new' do
- subject { Notify.new_issue_email(issue.id) }
+ subject { Notify.new_issue_email(issue.assignee_id, issue.id) }
it_behaves_like 'an assignee email'
@@ -172,7 +172,7 @@ describe Notify do
let(:merge_request) { create(:merge_request, assignee: assignee, project: project) }
describe 'that are new' do
- subject { Notify.new_merge_request_email(merge_request.id) }
+ subject { Notify.new_merge_request_email(merge_request.assignee_id, merge_request.id) }
it_behaves_like 'an assignee email'