##// END OF EJS Templates
link_to in Redmine::Hook::ViewListener omits relative url root (#19024)....
Jean-Philippe Lang -
r13578:d347fd4d39ff
parent child
Show More
@@ -96,7 +96,7 module Redmine
96 96 # Default to creating links using only the path. Subclasses can
97 97 # change this default as needed
98 98 def self.default_url_options
99 {:only_path => true }
99 {:only_path => true, :script_name => Redmine::Utils.relative_url_root}
100 100 end
101 101
102 102 # Helper method to directly render using the context,
@@ -114,6 +114,15 class Redmine::Hook::ManagerTest < ActionView::TestCase
114 114 assert_equal ['<a href="/issues">Issues</a>'], hook_helper.call_hook(:view_layouts_base_html_head)
115 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 126 # Context: Redmine::Hook::Helper.call_hook
118 127 def test_call_hook_with_project_added_to_context
119 128 @hook_module.add_listener(TestHook3)
General Comments 0
You need to be logged in to leave comments. Login now