Feature #2542 » hook_test_diff_for_link_test.patch
| hook_test.rb Locally Modified (Based On LOCAL) | ||
|---|---|---|
| 19 | 19 |
|
| 20 | 20 |
class Redmine::Hook::ManagerTest < Test::Unit::TestCase |
| 21 | 21 |
|
| 22 |
fixtures :issues |
|
| 23 |
|
|
| 22 | 24 |
# Some hooks that are manually registered in these tests |
| 23 | 25 |
class TestHook < Redmine::Hook::ViewListener; end |
| 24 | 26 |
|
| ... | ... | |
| 107 | 109 |
assert_equal ['<a href="/issues">Issues</a>'], @hook_helper.call_hook(:view_layouts_base_html_head) |
| 108 | 110 |
end |
| 109 | 111 |
|
| 112 |
def test_call_hook_will_break_issue_link_in_mail |
|
| 113 |
issue = Issue.find(1) |
|
| 114 |
|
|
| 115 |
ActionMailer::Base.deliveries.clear |
|
| 116 |
Mailer.deliver_issue_add(issue) |
|
| 117 |
mail = ActionMailer::Base.deliveries.last |
|
| 118 |
puts mail.body |
|
| 119 |
|
|
| 120 |
@hook_module.add_listener(TestLinkToHook) |
|
| 121 |
@hook_helper.call_hook(:view_layouts_base_html_head) |
|
| 122 |
|
|
| 123 |
ActionMailer::Base.deliveries.clear |
|
| 124 |
Mailer.deliver_issue_add(issue) |
|
| 125 |
mail2 = ActionMailer::Base.deliveries.last |
|
| 126 |
puts mail2.body |
|
| 127 |
|
|
| 128 |
assert_equal mail.body, mail2.body |
|
| 129 |
end |
|
| 130 |
|
|
| 110 | 131 |
# Context: Redmine::Hook::Helper.call_hook |
| 111 | 132 |
def test_call_hook_with_project_added_to_context |
| 112 | 133 |
@hook_module.add_listener(TestHook3) |
- « Previous
- 1
- 2
- 3
- Next »