##// END OF EJS Templates
replace RAILS_ROOT to Rails.root at test/unit/lib/redmine/hook_test.rb....
Toshi MARUYAMA -
r5969:05f83d180e32
parent child
Show More
@@ -1,16 +1,16
1 # redMine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2008 Jean-Philippe Lang
2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -20,7 +20,7 require File.expand_path('../../../../test_helper', __FILE__)
20 class Redmine::Hook::ManagerTest < ActiveSupport::TestCase
20 class Redmine::Hook::ManagerTest < ActiveSupport::TestCase
21
21
22 fixtures :issues
22 fixtures :issues
23
23
24 # Some hooks that are manually registered in these tests
24 # Some hooks that are manually registered in these tests
25 class TestHook < Redmine::Hook::ViewListener; end
25 class TestHook < Redmine::Hook::ViewListener; end
26
26
@@ -35,13 +35,13 class Redmine::Hook::ManagerTest < ActiveSupport::TestCase
35 'Test hook 2 listener.'
35 'Test hook 2 listener.'
36 end
36 end
37 end
37 end
38
38
39 class TestHook3 < TestHook
39 class TestHook3 < TestHook
40 def view_layouts_base_html_head(context)
40 def view_layouts_base_html_head(context)
41 "Context keys: #{context.keys.collect(&:to_s).sort.join(', ')}."
41 "Context keys: #{context.keys.collect(&:to_s).sort.join(', ')}."
42 end
42 end
43 end
43 end
44
44
45 class TestLinkToHook < TestHook
45 class TestLinkToHook < TestHook
46 def view_layouts_base_html_head(context)
46 def view_layouts_base_html_head(context)
47 link_to('Issues', :controller => 'issues')
47 link_to('Issues', :controller => 'issues')
@@ -166,7 +166,7 class Redmine::Hook::ManagerTest < ActiveSupport::TestCase
166 end
166 end
167
167
168 def view_hook_helper
168 def view_hook_helper
169 @view_hook_helper ||= TestHookHelperView.new(RAILS_ROOT + '/app/views')
169 @view_hook_helper ||= TestHookHelperView.new(Rails.root + '/app/views')
170 end
170 end
171 end
171 end
172
172
General Comments 0
You need to be logged in to leave comments. Login now