diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-02-17 14:17:20 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-02-17 14:17:20 +0000 |
commit | e5daf25618e017e50293a77ea33ddc51cf1603b3 (patch) | |
tree | ce8179ab433b135cf2051b54abb1123a7264b7ea /test/unit/mailer_test.rb | |
parent | 5d6d0136c1322a209bb17077fa908659a756a998 (diff) | |
download | redmine-e5daf25618e017e50293a77ea33ddc51cf1603b3.tar.gz redmine-e5daf25618e017e50293a77ea33ddc51cf1603b3.zip |
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
Diffstat (limited to 'test/unit/mailer_test.rb')
-rw-r--r-- | test/unit/mailer_test.rb | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb index 096551ee5..dc3fde414 100644 --- a/test/unit/mailer_test.rb +++ b/test/unit/mailer_test.rb @@ -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 |