diff options
author | John Hawthorn <john@hawthorn.email> | 2019-03-27 15:35:12 -0700 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2019-03-27 16:47:48 -0700 |
commit | 06c703570ad353cd13e7b0630ff74cfdb4bbdc21 (patch) | |
tree | 183f90385639b6e2ed64d13689e79515fbccf217 /actionpack/test | |
parent | 93dbbe3a81bee6da2f1e88ca6971299b462cad93 (diff) | |
download | rails-06c703570ad353cd13e7b0630ff74cfdb4bbdc21.tar.gz rails-06c703570ad353cd13e7b0630ff74cfdb4bbdc21.tar.bz2 rails-06c703570ad353cd13e7b0630ff74cfdb4bbdc21.zip |
Remove :all symbol from Mime::ALL
.all isn't a valid file extension, so it shouldn't used as a symbol.
This also makes Mime::ALL better match how */* is parsed from an Accept
header.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/mime/respond_to_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/controller/mime/respond_to_test.rb b/actionpack/test/controller/mime/respond_to_test.rb index 21de05b323..2f8f191828 100644 --- a/actionpack/test/controller/mime/respond_to_test.rb +++ b/actionpack/test/controller/mime/respond_to_test.rb @@ -158,6 +158,12 @@ class RespondToController < ActionController::Base end end + def handle_any_with_template + respond_to do |type| + type.any { render "test/hello_world" } + end + end + def all_types_with_layout respond_to do |type| type.html @@ -572,6 +578,13 @@ class RespondToControllerTest < ActionController::TestCase assert_equal "HTML", @response.body end + def test_handle_any_with_template + @request.accept = "*/*" + + get :handle_any_with_template + assert_equal "Hello world!", @response.body + end + def test_html_type_with_layout @request.accept = "text/html" get :all_types_with_layout |