diff options
author | grosser <grosser.michael@gmail.com> | 2012-10-02 09:22:26 -0700 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2013-02-24 11:47:20 -0500 |
commit | 149e3cd376caa23cf4d8c4b711b95e157186fc94 (patch) | |
tree | 150e9888b1bae14ceee17d9b39ee4f60188b56d2 /actionpack/test/controller | |
parent | c3d001b04854d4592d2a16aeddf1b9be006b58a8 (diff) | |
download | rails-149e3cd376caa23cf4d8c4b711b95e157186fc94.tar.gz rails-149e3cd376caa23cf4d8c4b711b95e157186fc94.tar.bz2 rails-149e3cd376caa23cf4d8c4b711b95e157186fc94.zip |
fix respond_to without blocks not working if one of the blocks is all
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/mime_responds_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb index ed013e2185..a9c62899b5 100644 --- a/actionpack/test/controller/mime_responds_test.rb +++ b/actionpack/test/controller/mime_responds_test.rb @@ -80,6 +80,13 @@ class RespondToController < ActionController::Base respond_to(:html, :xml) end + def using_defaults_with_all + respond_to do |type| + type.html + type.all{ render text: "ALL" } + end + end + def made_for_content_type respond_to do |type| type.rss { render :text => "RSS" } @@ -301,6 +308,20 @@ class RespondToControllerTest < ActionController::TestCase assert_equal "<p>Hello world!</p>\n", @response.body end + def test_using_defaults_with_all + @request.accept = "*/*" + get :using_defaults_with_all + assert_equal "HTML!", @response.body.strip + + @request.accept = "text/html" + get :using_defaults_with_all + assert_equal "HTML!", @response.body.strip + + @request.accept = "application/json" + get :using_defaults_with_all + assert_equal "ALL", @response.body + end + def test_using_defaults_with_type_list @request.accept = "*/*" get :using_defaults_with_type_list |