diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-08-31 11:34:46 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-08-31 11:34:46 -0500 |
commit | 086c3520c47c6c001b3ddbba8881b4175c433ed1 (patch) | |
tree | 23ca936ee79d23046caa0dcc5109c1e6ffcb6658 /actionpack/test/controller | |
parent | 8eec694598978ec054d8fc8daf2ee704baf794fe (diff) | |
download | rails-086c3520c47c6c001b3ddbba8881b4175c433ed1.tar.gz rails-086c3520c47c6c001b3ddbba8881b4175c433ed1.tar.bz2 rails-086c3520c47c6c001b3ddbba8881b4175c433ed1.zip |
Moved layout exemption logic into the view
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/layout_test.rb | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/actionpack/test/controller/layout_test.rb b/actionpack/test/controller/layout_test.rb index 71f110f241..1120fdbff5 100644 --- a/actionpack/test/controller/layout_test.rb +++ b/actionpack/test/controller/layout_test.rb @@ -79,53 +79,6 @@ class LayoutAutoDiscoveryTest < Test::Unit::TestCase end 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 - assert @controller.send!(:template_exempt_from_layout?, 'test.rjs') - end - - def test_rhtml_and_rxml_not_exempt_from_layout - assert !@controller.send!(:template_exempt_from_layout?, 'test.rhtml') - assert !@controller.send!(:template_exempt_from_layout?, 'test.rxml') - end - - def test_other_extension_not_exempt_from_layout - assert !@controller.send!(:template_exempt_from_layout?, 'test.random') - end - - def test_add_extension_to_exempt_from_layout - ['rpdf', :rpdf].each do |ext| - assert_nothing_raised do - ActionController::Base.exempt_from_layout ext - end - assert @controller.send!(:template_exempt_from_layout?, "test.#{ext}") - end - end - - def test_add_regexp_to_exempt_from_layout - ActionController::Base.exempt_from_layout /\.rdoc/ - assert @controller.send!(:template_exempt_from_layout?, 'test.rdoc') - end - - 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') - assert @controller.send!(:template_exempt_from_layout?, 'hello.rhtml') - - get :hello - assert_equal 'hello.rhtml', @response.body - ActionController::Base.exempt_from_layout.delete(/\.rhtml$/) - end -end - - class DefaultLayoutController < LayoutTest end @@ -179,8 +132,6 @@ class LayoutSetInResponseTest < Test::Unit::TestCase 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 |