Deprecation: remove deprecated request methods.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6401 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
cb6d94cc57
commit
0631400b4a
@ -1,6 +1,6 @@
|
||||
*SVN*
|
||||
|
||||
* Deprecation: remove deprecated instance variables and redirect methods. [Jeremy Kemper]
|
||||
* Deprecation: remove deprecated instance variables, request methods, and redirect methods. [Jeremy Kemper]
|
||||
|
||||
* Consistent public/protected/private visibility for chained methods. #7813 [Dan Manges]
|
||||
|
||||
|
@ -38,7 +38,6 @@
|
||||
|
||||
require 'action_controller/base'
|
||||
require 'action_controller/request'
|
||||
require 'action_controller/deprecated_request_methods'
|
||||
require 'action_controller/rescue'
|
||||
require 'action_controller/benchmarking'
|
||||
require 'action_controller/flash'
|
||||
|
@ -1,34 +0,0 @@
|
||||
module ActionController
|
||||
class AbstractRequest
|
||||
# Determine whether the body of a HTTP call is URL-encoded (default)
|
||||
# or matches one of the registered param_parsers.
|
||||
#
|
||||
# For backward compatibility, the post format is extracted from the
|
||||
# X-Post-Data-Format HTTP header if present.
|
||||
def post_format
|
||||
case content_type
|
||||
when Mime::XML
|
||||
:xml
|
||||
when Mime::YAML
|
||||
:yaml
|
||||
else
|
||||
:url_encoded
|
||||
end
|
||||
end
|
||||
|
||||
# Is this a POST request formatted as XML or YAML?
|
||||
def formatted_post?
|
||||
post? && (post_format == :yaml || post_format == :xml)
|
||||
end
|
||||
|
||||
# Is this a POST request formatted as XML?
|
||||
def xml_post?
|
||||
post? && post_format == :xml
|
||||
end
|
||||
|
||||
# Is this a POST request formatted as YAML?
|
||||
def yaml_post?
|
||||
post? && post_format == :yaml
|
||||
end
|
||||
end
|
||||
end
|
@ -99,15 +99,6 @@ def test_use_xml_ximple_with_empty_request
|
||||
assert_equal "", @controller.response.body
|
||||
end
|
||||
|
||||
def test_deprecated_request_methods
|
||||
process('POST', 'application/x-yaml')
|
||||
assert_equal Mime::YAML, @controller.request.content_type
|
||||
assert_equal true, @controller.request.post?
|
||||
assert_equal :yaml, @controller.request.post_format
|
||||
assert_equal true, @controller.request.yaml_post?
|
||||
assert_equal false, @controller.request.xml_post?
|
||||
end
|
||||
|
||||
def test_dasherized_keys_as_xml
|
||||
ActionController::Base.param_parsers[Mime::XML] = :xml_simple
|
||||
process('POST', 'application/xml', "<first-key>\n<sub-key>...</sub-key>\n</first-key>", true)
|
||||
|
Loading…
Reference in New Issue
Block a user