Add the description to the "new issue" and "new merge request" emails

Previously the content of the issue or merge request was missing from
the email.
parent b59d105c
%p -if @issue.description
New Issue was created. = markdown(@issue.description)
%p
Author: #{@issue.author_name} - if @issue.assignee_id.present?
%p %p
Assignee: #{@issue.assignee_name} Assignee: #{@issue.assignee_name}
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
= "New Merge Request ##{@merge_request.iid}" = "New Merge Request ##{@merge_request.iid}"
%p %p
!= merge_path_description(@merge_request, '→') != merge_path_description(@merge_request, '→')
%p
- if @merge_request.assignee_id.present?
%p
Assignee: #{@merge_request.author_name} → #{@merge_request.assignee_name} Assignee: #{@merge_request.author_name} → #{@merge_request.assignee_name}
-if @merge_request.description
= markdown(@merge_request.description)
...@@ -146,7 +146,8 @@ describe Notify do ...@@ -146,7 +146,8 @@ describe Notify do
end end
context 'for issues' do context 'for issues' do
let(:issue) { create(:issue, author: current_user, assignee: assignee, project: project ) } let(:issue) { create(:issue, author: current_user, assignee: assignee, project: project) }
let(:issue_with_description) { create(:issue, author: current_user, assignee: assignee, project: project, description: Faker::Lorem.sentence) }
describe 'that are new' do describe 'that are new' do
subject { Notify.new_issue_email(issue.assignee_id, issue.id) } subject { Notify.new_issue_email(issue.assignee_id, issue.id) }
...@@ -162,6 +163,14 @@ describe Notify do ...@@ -162,6 +163,14 @@ describe Notify do
end end
end end
describe 'that are new with a description' do
subject { Notify.new_issue_email(issue_with_description.assignee_id, issue_with_description.id) }
it 'contains the description' do
should have_body_text /#{issue_with_description.description}/
end
end
describe 'that have been reassigned' do describe 'that have been reassigned' do
subject { Notify.reassigned_issue_email(recipient.id, issue.id, previous_assignee.id, current_user) } subject { Notify.reassigned_issue_email(recipient.id, issue.id, previous_assignee.id, current_user) }
...@@ -221,6 +230,7 @@ describe Notify do ...@@ -221,6 +230,7 @@ describe Notify do
context 'for merge requests' do context 'for merge requests' do
let(:merge_request) { create(:merge_request, author: current_user, assignee: assignee, source_project: project, target_project: project) } let(:merge_request) { create(:merge_request, author: current_user, assignee: assignee, source_project: project, target_project: project) }
let(:merge_request_with_description) { create(:merge_request, author: current_user, assignee: assignee, source_project: project, target_project: project, description: Faker::Lorem.sentence) }
describe 'that are new' do describe 'that are new' do
subject { Notify.new_merge_request_email(merge_request.assignee_id, merge_request.id) } subject { Notify.new_merge_request_email(merge_request.assignee_id, merge_request.id) }
...@@ -244,6 +254,14 @@ describe Notify do ...@@ -244,6 +254,14 @@ describe Notify do
end end
end end
describe 'that are new with a description' do
subject { Notify.new_merge_request_email(merge_request_with_description.assignee_id, merge_request_with_description.id) }
it 'contains the description' do
should have_body_text /#{merge_request_with_description.description}/
end
end
describe 'that are reassigned' do describe 'that are reassigned' do
subject { Notify.reassigned_merge_request_email(recipient.id, merge_request.id, previous_assignee.id, current_user.id) } subject { Notify.reassigned_merge_request_email(recipient.id, merge_request.id, previous_assignee.id, current_user.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