diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-30 22:59:24 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-30 22:59:24 +0000 |
commit | 860cf2d44e01114af8ce83fffee3689df812a55c (patch) | |
tree | 35e3291052fb24eb13e3ca712ee0cebac6a9b6df /actionpack/test/controller/layout_test.rb | |
parent | 6ca789bf005caadd4200b6bf788521dfe1d40287 (diff) | |
download | rails-860cf2d44e01114af8ce83fffee3689df812a55c.tar.gz rails-860cf2d44e01114af8ce83fffee3689df812a55c.tar.bz2 rails-860cf2d44e01114af8ce83fffee3689df812a55c.zip |
Fixed that render template did not honor exempt_from_layout (closes #9698) [pezra]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7701 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/layout_test.rb')
-rw-r--r-- | actionpack/test/controller/layout_test.rb | 18 |
1 files changed, 18 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" |