diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/layout_test.rb | 18 | ||||
-rw-r--r-- | actionpack/test/fixtures/layout_tests/alt/hello.rhtml | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/actionpack/test/controller/layout_test.rb b/actionpack/test/controller/layout_test.rb index cad5720742..f194539fcf 100644 --- a/actionpack/test/controller/layout_test.rb +++ b/actionpack/test/controller/layout_test.rb @@ -180,8 +180,26 @@ class LayoutSetInResponseTest < Test::Unit::TestCase get :hello assert_nil @response.layout end + + def test_exempt_from_layout_honored_by_render_template + ActionController::Base.exempt_from_layout :rhtml + @controller = RenderWithTemplateOptionController.new + + assert @controller.send(:template_exempt_from_layout?, 'alt/hello.rhtml') + + get :hello + assert_equal "alt/hello.rhtml", @response.body.strip + + ensure + ActionController::Base.exempt_from_layout.delete(/\.rhtml$/) + end end +class RenderWithTemplateOptionController < LayoutTest + def hello + render :template => 'alt/hello' + end +end class SetsNonExistentLayoutFile < LayoutTest layout "nofile.rhtml" diff --git a/actionpack/test/fixtures/layout_tests/alt/hello.rhtml b/actionpack/test/fixtures/layout_tests/alt/hello.rhtml new file mode 100644 index 0000000000..fcda6cf97a --- /dev/null +++ b/actionpack/test/fixtures/layout_tests/alt/hello.rhtml @@ -0,0 +1 @@ +alt/hello.rhtml |