@@ -96,7 +96,7 module Redmine | |||||
96 | # Default to creating links using only the path. Subclasses can |
|
96 | # Default to creating links using only the path. Subclasses can | |
97 | # change this default as needed |
|
97 | # change this default as needed | |
98 | def self.default_url_options |
|
98 | def self.default_url_options | |
99 | {:only_path => true } |
|
99 | {:only_path => true, :script_name => Redmine::Utils.relative_url_root} | |
100 | end |
|
100 | end | |
101 |
|
101 | |||
102 | # Helper method to directly render using the context, |
|
102 | # Helper method to directly render using the context, |
@@ -114,6 +114,15 class Redmine::Hook::ManagerTest < ActionView::TestCase | |||||
114 | assert_equal ['<a href="/issues">Issues</a>'], hook_helper.call_hook(:view_layouts_base_html_head) |
|
114 | assert_equal ['<a href="/issues">Issues</a>'], hook_helper.call_hook(:view_layouts_base_html_head) | |
115 | end |
|
115 | end | |
116 |
|
116 | |||
|
117 | def test_view_hook_should_generate_links_with_relative_url_root | |||
|
118 | Redmine::Utils.relative_url_root = '/foo' | |||
|
119 | @hook_module.add_listener(TestLinkToHook) | |||
|
120 | ||||
|
121 | assert_equal ['<a href="/foo/issues">Issues</a>'], hook_helper.call_hook(:view_layouts_base_html_head) | |||
|
122 | ensure | |||
|
123 | Redmine::Utils.relative_url_root = '' | |||
|
124 | end | |||
|
125 | ||||
117 | # Context: Redmine::Hook::Helper.call_hook |
|
126 | # Context: Redmine::Hook::Helper.call_hook | |
118 | def test_call_hook_with_project_added_to_context |
|
127 | def test_call_hook_with_project_added_to_context | |
119 | @hook_module.add_listener(TestHook3) |
|
128 | @hook_module.add_listener(TestHook3) |
General Comments 0
You need to be logged in to leave comments.
Login now