diff options
author | Sam Stephenson <sam@37signals.com> | 2005-10-13 18:09:27 +0000 |
---|---|---|
committer | Sam Stephenson <sam@37signals.com> | 2005-10-13 18:09:27 +0000 |
commit | 4b72a4b12fbb33d32ae3f9b9d004ca5888d42d58 (patch) | |
tree | df19921e5ae86f0b49d1d93e6f3aef867fc75641 /actionpack/lib/action_controller | |
parent | f60f76eab021c9dcfe3b67de3fd41288061f3065 (diff) | |
download | rails-4b72a4b12fbb33d32ae3f9b9d004ca5888d42d58.tar.gz rails-4b72a4b12fbb33d32ae3f9b9d004ca5888d42d58.tar.bz2 rails-4b72a4b12fbb33d32ae3f9b9d004ca5888d42d58.zip |
Unset the X-Requested-With header when using the xhr wrapper in functional tests. Closes #2352.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2551 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/test_process.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb index 783d21ff53..f7b4280d2e 100644 --- a/actionpack/lib/action_controller/test_process.rb +++ b/actionpack/lib/action_controller/test_process.rb @@ -303,7 +303,9 @@ module Test def xml_http_request(request_method, action, parameters = nil, session = nil, flash = nil) @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' - self.send(request_method, action, parameters, session, flash) + returning self.send(request_method, action, parameters, session, flash) do + @request.env.delete 'HTTP_X_REQUESTED_WITH' + end end alias xhr :xml_http_request |