diff options
author | Rick Olson <technoweenie@gmail.com> | 2007-08-15 18:59:37 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2007-08-15 18:59:37 +0000 |
commit | 0127e586d05f3e8342744608315747da488642eb (patch) | |
tree | 3f3658068188de642cbaeb648033d74996e26f60 /actionpack/test | |
parent | d0c83c435459b3fff53075a84411f39707f31325 (diff) | |
download | rails-0127e586d05f3e8342744608315747da488642eb.tar.gz rails-0127e586d05f3e8342744608315747da488642eb.tar.bz2 rails-0127e586d05f3e8342744608315747da488642eb.zip |
Find layouts even if they're not in the first view_paths directory. Closes #9258 [caio]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7321 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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 d6d6dac4f3..c84ced5394 100644 --- a/actionpack/test/controller/view_paths_test.rb +++ b/actionpack/test/controller/view_paths_test.rb @@ -18,6 +18,11 @@ class ViewLoadPathsTest < Test::Unit::TestCase end end + class Test::SubController < ActionController::Base + layout 'test/sub' + def hello_world; render 'test/hello_world'; end + end + def setup TestController.view_paths = [ LOAD_PATH_ROOT ] @controller = TestController.new @@ -27,7 +32,7 @@ class ViewLoadPathsTest < Test::Unit::TestCase # Track the last warning. @old_behavior = ActiveSupport::Deprecation.behavior @last_message = nil - ActiveSupport::Deprecation.behavior = Proc.new { |message| @last_message = message } + ActiveSupport::Deprecation.behavior = Proc.new { |message, callback| @last_message = message } end def teardown @@ -51,6 +56,14 @@ class ViewLoadPathsTest < Test::Unit::TestCase assert_equal "Hello overridden world!", @response.body end + def test_view_paths_override_for_layouts_in_controllers_with_a_module + @controller = Test::SubController.new + Test::SubController.view_paths = [ "#{LOAD_PATH_ROOT}/override", LOAD_PATH_ROOT, "#{LOAD_PATH_ROOT}/override2" ] + get :hello_world + assert_response :success + assert_equal "layout: Hello overridden world!", @response.body + end + def test_view_paths_override_at_request_time get :hello_world_at_request_time assert_response :success |