diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/mime_responds_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb index d18d4679d4..9118d9e553 100644 --- a/actionpack/test/controller/mime_responds_test.rb +++ b/actionpack/test/controller/mime_responds_test.rb @@ -72,6 +72,18 @@ class RespondToController < ActionController::Base Mime.send :remove_const, :MOBILE end + + def custom_constant_handling_without_block + Mime::Type.register("text/x-mobile", :mobile) + + respond_to do |type| + type.html { render :text => "HTML" } + type.mobile + end + + Mime.send :remove_const, :MOBILE + end + def handle_any respond_to do |type| @@ -271,6 +283,13 @@ class MimeControllerTest < Test::Unit::TestCase assert_equal "Mobile", @response.body end + def custom_constant_handling_without_block + + assert_raised(ActionController::RenderError) do + get :custom_constant_handling, :format => "mobile" + end + end + def test_forced_format get :html_xml_or_rss assert_equal "HTML", @response.body |