BigW Consortium Gitlab

Commit 224c2add by Bob Van Landuyt

No need to look up the notable separately in the ResolveService

The merge request will now always be there when the discussion was resolved by creating a new issue.
parent dcec4c53
......@@ -9,13 +9,7 @@ module Discussions
discussion.resolve!(current_user)
notify_discussion_resolved(discussion)
end
def notify_discussion_resolved(discussion)
noteable = merge_request || discussion.noteable
MergeRequests::ResolvedDiscussionNotificationService.new(project, current_user).execute(noteable)
MergeRequests::ResolvedDiscussionNotificationService.new(project, current_user).execute(merge_request)
SystemNoteService.discussion_continued_in_issue(discussion, project, current_user, follow_up_issue) if follow_up_issue
end
......
......@@ -6,7 +6,7 @@ describe Discussions::ResolveService do
let(:project) { merge_request.project }
let(:merge_request) { discussion.noteable }
let(:user) { create(:user) }
let(:service) { described_class.new(discussion.noteable.project, user) }
let(:service) { described_class.new(discussion.noteable.project, user, merge_request: merge_request) }
before do
project.team << [user, :master]
......
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