diff options
author | Jamis Buck <jamis@37signals.com> | 2006-03-14 19:53:27 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2006-03-14 19:53:27 +0000 |
commit | 953d7c9aa4f1cf9ec16cbfcdeb2b1703df7d51a3 (patch) | |
tree | b7bc1adc06e1db6007c2f67a5ba01ed61141def3 /actionpack/lib/action_controller | |
parent | 4965a754d5c9bfde332398c653e003c749e62cf9 (diff) | |
download | rails-953d7c9aa4f1cf9ec16cbfcdeb2b1703df7d51a3.tar.gz rails-953d7c9aa4f1cf9ec16cbfcdeb2b1703df7d51a3.tar.bz2 rails-953d7c9aa4f1cf9ec16cbfcdeb2b1703df7d51a3.zip |
Make the xml_http_request testing method set the HTTP_ACCEPT header
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3867 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/test_process.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb index afc33afc58..7dfc16785a 100644 --- a/actionpack/lib/action_controller/test_process.rb +++ b/actionpack/lib/action_controller/test_process.rb @@ -317,8 +317,10 @@ module ActionController #:nodoc: def xml_http_request(request_method, action, parameters = nil, session = nil, flash = nil) @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' + @request.env['HTTP_ACCEPT'] = 'text/javascript, text/html, application/xml, text/xml, */*' returning self.send(request_method, action, parameters, session, flash) do @request.env.delete 'HTTP_X_REQUESTED_WITH' + @request.env.delete 'HTTP_ACCEPT' end end alias xhr :xml_http_request |