diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-03-05 04:18:02 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-03-05 04:18:02 -0800 |
commit | 0df96475973cf94b178de1825d935f42a6bd642e (patch) | |
tree | 16b27e530bb780805ff0ba69ae3621a0c1d8b534 /actionpack/test | |
parent | 927e649bc9dc5740285e4b4e9899421c2bbfefbe (diff) | |
parent | d0f22a99f9f24d07990e02da55ed937c98d41e03 (diff) | |
download | rails-0df96475973cf94b178de1825d935f42a6bd642e.tar.gz rails-0df96475973cf94b178de1825d935f42a6bd642e.tar.bz2 rails-0df96475973cf94b178de1825d935f42a6bd642e.zip |
Merge pull request #9543 from maximerety/backport_fix_7774
Backported #7774 to 3-2-stable
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/request_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb index dfd3ddbfa6..222cdfde1f 100644 --- a/actionpack/test/dispatch/request_test.rb +++ b/actionpack/test/dispatch/request_test.rb @@ -481,6 +481,15 @@ class RequestTest < ActiveSupport::TestCase request.expects(:parameters).at_least_once.returns({}) assert_equal [ Mime::HTML ], request.formats + request = stub_request 'HTTP_ACCEPT' => '' + request.expects(:parameters).at_least_once.returns({}) + assert_equal [Mime::HTML], request.formats + + request = stub_request 'HTTP_ACCEPT' => '', + 'HTTP_X_REQUESTED_WITH' => "XMLHttpRequest" + request.expects(:parameters).at_least_once.returns({}) + assert_equal [Mime::JS], request.formats + request = stub_request 'CONTENT_TYPE' => 'application/xml; charset=UTF-8', 'HTTP_X_REQUESTED_WITH' => "XMLHttpRequest" request.expects(:parameters).at_least_once.returns({}) |