aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-03-27 20:12:05 -0400
committerGitHub <noreply@github.com>2019-03-27 20:12:05 -0400
commit5f043c0094173a26bea1cfc15c6d3bdbe8c9954b (patch)
tree183f90385639b6e2ed64d13689e79515fbccf217
parent93dbbe3a81bee6da2f1e88ca6971299b462cad93 (diff)
parent06c703570ad353cd13e7b0630ff74cfdb4bbdc21 (diff)
downloadrails-5f043c0094173a26bea1cfc15c6d3bdbe8c9954b.tar.gz
rails-5f043c0094173a26bea1cfc15c6d3bdbe8c9954b.tar.bz2
rails-5f043c0094173a26bea1cfc15c6d3bdbe8c9954b.zip
Merge pull request #35775 from jhawthorn/remove_all_symbol_from_mime_all
Remove :all symbol from Mime::ALL
-rw-r--r--actionpack/lib/action_dispatch/http/mime_type.rb2
-rw-r--r--actionpack/test/controller/mime/respond_to_test.rb13
2 files changed, 14 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb
index 962d10d81b..88b3a93211 100644
--- a/actionpack/lib/action_dispatch/http/mime_type.rb
+++ b/actionpack/lib/action_dispatch/http/mime_type.rb
@@ -315,7 +315,7 @@ module Mime
include Singleton
def initialize
- super "*/*", :all
+ super "*/*", nil
end
def all?; true; end
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