aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/test/controller/layout_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/layout_test.rb b/actionpack/test/controller/layout_test.rb
index 3e1d3d9644..93ef1560f6 100644
--- a/actionpack/test/controller/layout_test.rb
+++ b/actionpack/test/controller/layout_test.rb
@@ -75,6 +75,8 @@ end
class ExemptFromLayoutTest < Test::Unit::TestCase
def setup
@controller = LayoutTest.new
+ @request = ActionController::TestRequest.new
+ @response = ActionController::TestResponse.new
end
def test_rjs_exempt_from_layout
@@ -103,6 +105,16 @@ class ExemptFromLayoutTest < Test::Unit::TestCase
ActionController::Base.exempt_from_layout /\.rdoc/
assert @controller.send(:template_exempt_from_layout?, 'test.rdoc')
end
+
+ # TODO: http://dev.rubyonrails.org/ticket/6742
+ # The rhtml exemption is ignored.
+ def test_rhtml_exempt_from_layout_status_should_prevent_layout_render
+ ActionController::Base.exempt_from_layout :rhtml
+ assert @controller.send(:template_exempt_from_layout?, 'test.rhtml')
+
+ get :hello
+ assert_equal 'hello.rhtml', @response.body
+ end
end