Project

General

Profile

Feature #34302 » 34302.patch

Yuichi HARADA, 2020-12-10 01:59

View differences:

app/helpers/issues_helper.rb
def email_issue_attributes(issue, user, html)
items = []
%w(author status priority assigned_to category fixed_version start_date due_date).each do |attribute|
%w(author status priority assigned_to category fixed_version start_date due_date parent_issue).each do |attribute|
if issue.disabled_core_fields.grep(/^#{attribute}(_id)?$/).empty?
attr_value = (issue.send attribute).to_s
next if attr_value.blank?
app/models/issue.rb
end
end
alias :parent_issue :parent
def set_parent_id
self.parent_id = parent_issue_id
end
test/unit/mailer_test.rb
ActionMailer::Base.deliveries.clear
with_settings :notified_events => %w(issue_added) do
cf = IssueCustomField.generate!
issue = Issue.generate!
issue = Issue.generate!(:parent => Issue.find(1))
Mailer.deliver_issue_add(issue)
assert_not_equal 0, ActionMailer::Base.deliveries.size
......
assert_mail_body_match /^\* Author: /, mail
assert_mail_body_match /^\* Status: /, mail
assert_mail_body_match /^\* Priority: /, mail
assert_mail_body_match /^\* Parent task: /, mail
assert_mail_body_no_match /^\* Assignee: /, mail
assert_mail_body_no_match /^\* Category: /, mail
(3-3/3)