Ticket #7124: alias_xhr_to_xml_http_request.diff
| File alias_xhr_to_xml_http_request.diff, 1.5 kB (added by nik.wakelin, 2 years ago) |
|---|
-
actionpack/test/controller/integration_test.rb
old new 141 141 @session.expects(:post).with(path,params,headers_after_xhr) 142 142 @session.xml_http_request(path,params,headers) 143 143 end 144 145 def test_xhr_is_aliased_to_xml_http_request 146 path = "/index"; params = "blah"; headers = {:location => 'blah'} 147 headers_after_xhr = headers.merge( 148 "X-Requested-With" => "XMLHttpRequest", 149 "Accept" => "text/javascript, text/html, application/xml, text/xml, */*" 150 ) 151 @session.expects(:post).with(path,params,headers_after_xhr) 152 @session.xhr(path,params,headers) 153 end 154 155 144 156 end 145 157 146 158 # TODO -
actionpack/lib/action_controller/integration.rb
old new 186 186 187 187 post(path, parameters, headers) 188 188 end 189 190 alias xhr :xml_http_request 189 191 190 192 # Returns the URL for the given options, according to the rules specified 191 193 # in the application's routes. … … 500 502 end 501 503 end 502 504 end 505 506 alias xhr :xml_http_request 503 507 504 508 # Open a new session instance. If a block is given, the new session is 505 509 # yielded to the block before being returned.