# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: D:\ruby\workspace\redmine\test\unit\lib\redmine # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: hook_test.rb --- hook_test.rb Base (BASE) +++ hook_test.rb Locally Modified (Based On LOCAL) @@ -19,6 +19,8 @@ class Redmine::Hook::ManagerTest < Test::Unit::TestCase + fixtures :issues + # Some hooks that are manually registered in these tests class TestHook < Redmine::Hook::ViewListener; end @@ -107,6 +109,25 @@ assert_equal ['Issues'], @hook_helper.call_hook(:view_layouts_base_html_head) end + def test_call_hook_will_break_issue_link_in_mail + issue = Issue.find(1) + + ActionMailer::Base.deliveries.clear + Mailer.deliver_issue_add(issue) + mail = ActionMailer::Base.deliveries.last + puts mail.body + + @hook_module.add_listener(TestLinkToHook) + @hook_helper.call_hook(:view_layouts_base_html_head) + + ActionMailer::Base.deliveries.clear + Mailer.deliver_issue_add(issue) + mail2 = ActionMailer::Base.deliveries.last + puts mail2.body + + assert_equal mail.body, mail2.body + end + # Context: Redmine::Hook::Helper.call_hook def test_call_hook_with_project_added_to_context @hook_module.add_listener(TestHook3)