diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-12-17 00:10:18 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-12-17 00:10:18 +0000 |
commit | 436da684dc3e85c4251d6e586913b8520add8638 (patch) | |
tree | a1a3dbcc4efbeb0502fee524854afd79ae59bef3 /actionpack/test | |
parent | 26e10218bc5e5c899b88f8d08b8abfb251b3af10 (diff) | |
download | rails-436da684dc3e85c4251d6e586913b8520add8638.tar.gz rails-436da684dc3e85c4251d6e586913b8520add8638.tar.bz2 rails-436da684dc3e85c4251d6e586913b8520add8638.zip |
Allow headers[Accept] to be set by hand when calling xml_http_request (closes #10461) [BMorearty]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8426 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/integration_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index 00269ca3b8..771e243b00 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -179,6 +179,15 @@ class SessionTest < Test::Unit::TestCase @session.expects(:process).with(:head,path,params,headers_after_xhr) @session.xml_http_request(:head,path,params,headers) end + + def test_xml_http_request_override_accept + path = "/index"; params = "blah"; headers = {:location => 'blah', "Accept" => "application/xml"} + headers_after_xhr = headers.merge( + "X-Requested-With" => "XMLHttpRequest" + ) + @session.expects(:process).with(:post,path,params,headers_after_xhr) + @session.xml_http_request(:post,path,params,headers) + end end class IntegrationTestTest < Test::Unit::TestCase |