aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/layout_test.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-02-22 23:52:02 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-02-22 23:52:02 +0100
commit21b80f8144f8f05a105b2989c79d3ed2f2d0d4cd (patch)
treebfec5946303ceb582674904c5f9927e9b4020272 /actionpack/test/controller/layout_test.rb
parent91ab75373f13054485f5d804d7e2c80d466ff5e0 (diff)
parent441e4e22352c8805a882f6a661ab3982dd7eda12 (diff)
downloadrails-21b80f8144f8f05a105b2989c79d3ed2f2d0d4cd.tar.gz
rails-21b80f8144f8f05a105b2989c79d3ed2f2d0d4cd.tar.bz2
rails-21b80f8144f8f05a105b2989c79d3ed2f2d0d4cd.zip
Merge commit 'mainstream/master'
Diffstat (limited to 'actionpack/test/controller/layout_test.rb')
-rw-r--r--actionpack/test/controller/layout_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/controller/layout_test.rb b/actionpack/test/controller/layout_test.rb
index 2f5e830fba..28555ee3d1 100644
--- a/actionpack/test/controller/layout_test.rb
+++ b/actionpack/test/controller/layout_test.rb
@@ -83,6 +83,13 @@ class HasOwnLayoutController < LayoutTest
layout 'item'
end
+class PrependsViewPathController < LayoutTest
+ def hello
+ prepend_view_path File.dirname(__FILE__) + '/../fixtures/layout_tests/alt/'
+ render :layout => 'alt'
+ end
+end
+
class SetsLayoutInRenderController < LayoutTest
def hello
render :layout => 'third_party_template_library'
@@ -130,6 +137,12 @@ class LayoutSetInResponseTest < ActionController::TestCase
ensure
ActionController::Base.exempt_from_layout.delete(/\.rhtml$/)
end
+
+ def test_layout_is_picked_from_the_controller_instances_view_path
+ @controller = PrependsViewPathController.new
+ get :hello
+ assert_equal 'layouts/alt', @response.layout
+ end
end
class RenderWithTemplateOptionController < LayoutTest
@@ -178,3 +191,4 @@ unless RUBY_PLATFORM =~ /(:?mswin|mingw|bccwin)/
end
end
end
+