Fixes:
* email notifications: host name is missing in generated links (#639, #201) * email notifications: referenced changesets, wiki pages, attachments... are not turned into links (only ticket ids are) * attachment links and inline images don't work in issue notes git-svn-id: http://redmine.rubyforge.org/svn/trunk@1161 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Vendored
+1
-1
@@ -8,7 +8,7 @@ journals_001:
|
||||
journalized_id: 1
|
||||
journals_002:
|
||||
created_on: <%= 1.days.ago.to_date.to_s(:db) %>
|
||||
notes: "Some notes"
|
||||
notes: "Some notes with Redmine links: #2, r2."
|
||||
id: 2
|
||||
journalized_type: Issue
|
||||
user_id: 2
|
||||
|
||||
@@ -18,7 +18,26 @@
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
|
||||
class MailerTest < Test::Unit::TestCase
|
||||
fixtures :projects, :issues, :users, :members, :documents, :attachments, :news, :tokens, :journals, :journal_details, :trackers, :issue_statuses, :enumerations
|
||||
fixtures :projects, :issues, :users, :members, :documents, :attachments, :news, :tokens, :journals, :journal_details, :changesets, :trackers, :issue_statuses, :enumerations
|
||||
|
||||
def test_generated_links_in_emails
|
||||
ActionMailer::Base.deliveries.clear
|
||||
Setting.host_name = 'mydomain.foo'
|
||||
Setting.protocol = 'https'
|
||||
|
||||
journal = Journal.find(2)
|
||||
assert Mailer.deliver_issue_edit(journal)
|
||||
|
||||
mail = ActionMailer::Base.deliveries.last
|
||||
assert_kind_of TMail::Mail, mail
|
||||
# link to the main ticket
|
||||
assert mail.body.include?('<a href="https://mydomain.foo/issues/show/1">Bug #1: Can\'t print recipes</a>')
|
||||
|
||||
# link to a referenced ticket
|
||||
assert mail.body.include?('<a href="https://mydomain.foo/issues/show/2" class="issue" title="Add ingredients categories (Assigned)">#2</a>')
|
||||
# link to a changeset
|
||||
assert mail.body.include?('<a href="https://mydomain.foo/repositories/revision/1?rev=2" class="changeset" title="This commit fixes #1, #2 and references #1 & #3">r2</a>')
|
||||
end
|
||||
|
||||
# test mailer methods for each language
|
||||
def test_issue_add
|
||||
|
||||
Reference in New Issue
Block a user