diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/view_paths_test.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/actionpack/test/controller/view_paths_test.rb b/actionpack/test/controller/view_paths_test.rb index 6c07c40c0a..d6d6dac4f3 100644 --- a/actionpack/test/controller/view_paths_test.rb +++ b/actionpack/test/controller/view_paths_test.rb @@ -7,8 +7,15 @@ class ViewLoadPathsTest < Test::Unit::TestCase class TestController < ActionController::Base def self.controller_path() "test" end def rescue_action(e) raise end - + + before_filter :add_view_path, :only => :hello_world_at_request_time + def hello_world() end + def hello_world_at_request_time() render(:action => 'hello_world') end + private + def add_view_path + self.class.view_paths.unshift "#{LOAD_PATH_ROOT}/override" + end end def setup @@ -44,6 +51,12 @@ class ViewLoadPathsTest < Test::Unit::TestCase assert_equal "Hello overridden world!", @response.body end + def test_view_paths_override_at_request_time + get :hello_world_at_request_time + assert_response :success + assert_equal "Hello overridden world!", @response.body + end + def test_template_root_deprecated assert_deprecated(/template_root.*view_paths/) do TestController.template_root = 'foo/bar' |