Changeset 7436
- Timestamp:
- 09/09/07 23:00:17 (1 year ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/integration.rb (modified) (1 diff)
- trunk/actionpack/test/controller/integration_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r7434 r7436 1 1 *SVN* 2 3 * Removed deprecated form of calling xml_http_request/xhr without the first argument being the http verb [DHH] 2 4 3 5 * Removed deprecated methods [DHH]: trunk/actionpack/lib/action_controller/integration.rb
r7421 r7436 184 184 # the headers are a hash. Keys are automatically upcased and prefixed 185 185 # with 'HTTP_' if not already. 186 #187 # This method used to omit the request_method parameter, assuming it188 # was :post. This was deprecated in Rails 1.2.4. Always pass the request189 # method as the first argument.190 186 def xml_http_request(request_method, path, parameters = nil, headers = nil) 191 unless request_method.is_a?(Symbol)192 ActiveSupport::Deprecation.warn 'xml_http_request now takes the request_method (:get, :post, etc.) as the first argument. It used to assume :post, so add the :post argument to your existing method calls to silence this warning.'193 request_method, path, parameters, headers = :post, request_method, path, parameters194 end195 196 187 headers ||= {} 197 188 headers['X-Requested-With'] = 'XMLHttpRequest' trunk/actionpack/test/controller/integration_test.rb
r7010 r7436 131 131 end 132 132 133 def test_xml_http_request_deprecated_call134 path = "/index"; params = "blah"; headers = {:location => 'blah'}135 headers_after_xhr = headers.merge(136 "X-Requested-With" => "XMLHttpRequest",137 "Accept" => "text/javascript, text/html, application/xml, text/xml, */*"138 )139 @session.expects(:process).with(:post,path,params,headers_after_xhr)140 assert_deprecated { @session.xml_http_request(path,params,headers) }141 end142 143 133 def test_xml_http_request_get 144 134 path = "/index"; params = "blah"; headers = {:location => 'blah'}