Commit c5789b87 authored by David Kim's avatar David Kim

Add reviewer information to new_mention_in_merge_request_email

- it also fixes broken assignees_label
parent abb7fc8f
...@@ -60,6 +60,10 @@ class NotifyPreview < ActionMailer::Preview ...@@ -60,6 +60,10 @@ class NotifyPreview < ActionMailer::Preview
end end
end end
def new_mention_in_merge_request_email
Notify.new_mention_in_merge_request_email(user.id, issue.id, user.id).message
end
def closed_issue_email def closed_issue_email
Notify.closed_issue_email(user.id, issue.id, user.id).message Notify.closed_issue_email(user.id, issue.id, user.id).message
end end
......
...@@ -4,6 +4,7 @@ You have been mentioned in Merge Request <%= @merge_request.to_reference %> ...@@ -4,6 +4,7 @@ You have been mentioned in Merge Request <%= @merge_request.to_reference %>
<%= merge_path_description(@merge_request, 'to') %> <%= merge_path_description(@merge_request, 'to') %>
Author: <%= sanitize_name(@merge_request.author_name) %> Author: <%= sanitize_name(@merge_request.author_name) %>
= assignees_label(@merge_request) <%= assignees_label(@merge_request) %>
<%= reviewers_label(@merge_request) %>
<%= @merge_request.description %> <%= @merge_request.description %>
---
title: Add reviewers detail to new mention in merge request email
merge_request: 56184
author:
type: added
...@@ -24,6 +24,23 @@ RSpec.describe Emails::MergeRequests do ...@@ -24,6 +24,23 @@ RSpec.describe Emails::MergeRequests do
let(:recipient) { assignee } let(:recipient) { assignee }
let(:current_user_sanitized) { 'www_example_com' } let(:current_user_sanitized) { 'www_example_com' }
describe '#new_mention_in_merge_request_email' do
subject { Notify.new_mention_in_merge_request_email(recipient.id, merge_request.id, current_user.id) }
it 'has the correct subject and body' do
aggregate_failures do
is_expected.to have_referable_subject(merge_request, reply: true)
is_expected.to have_body_text(project_merge_request_path(project, merge_request))
is_expected.to have_body_text('You have been mentioned in Merge Request')
is_expected.to have_link(merge_request.to_reference, href: project_merge_request_url(merge_request.target_project, merge_request))
is_expected.to have_text_part_content(assignee.name)
is_expected.to have_text_part_content(reviewer.name)
is_expected.to have_html_part_content(assignee.name)
is_expected.to have_html_part_content(reviewer.name)
end
end
end
describe '#merge_request_unmergeable_email' do describe '#merge_request_unmergeable_email' do
subject { Notify.merge_request_unmergeable_email(recipient.id, merge_request.id) } subject { Notify.merge_request_unmergeable_email(recipient.id, merge_request.id) }
......
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