提交 06c70357 编写于 作者: J John Hawthorn

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.
上级 93dbbe3a
......@@ -315,7 +315,7 @@ class AllType < Type
include Singleton
def initialize
super "*/*", :all
super "*/*", nil
end
def all?; true; end
......
......@@ -158,6 +158,12 @@ def handle_any_any
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 @@ def test_browser_check_with_any_any
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册