diff options
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/request_test.rb | 6 | ||||
-rw-r--r-- | actionpack/test/dispatch/test_request_test.rb | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb index 25b1b4f745..060bcfb5ec 100644 --- a/actionpack/test/dispatch/request_test.rb +++ b/actionpack/test/dispatch/request_test.rb @@ -468,6 +468,12 @@ class RequestTest < ActiveSupport::TestCase assert request.formats.empty? end + test "formats with xhr request" do + request = stub_request 'HTTP_X_REQUESTED_WITH' => "XMLHttpRequest" + request.expects(:parameters).at_least_once.returns({}) + assert_equal [Mime::JS], request.formats + end + test "ignore_accept_header" do ActionDispatch::Request.ignore_accept_header = true diff --git a/actionpack/test/dispatch/test_request_test.rb b/actionpack/test/dispatch/test_request_test.rb index aa115608ef..4ee1d61146 100644 --- a/actionpack/test/dispatch/test_request_test.rb +++ b/actionpack/test/dispatch/test_request_test.rb @@ -40,6 +40,11 @@ class TestRequestTest < ActiveSupport::TestCase req.cookie_jar["login"] = "XJ-122" assert_cookies({"user_name" => "david", "login" => "XJ-122"}, req.cookie_jar) + assert_nothing_raised do + req.cookie_jar["login"] = nil + assert_cookies({"user_name" => "david", "login" => nil}, req.cookie_jar) + end + req.cookie_jar.delete(:login) assert_cookies({"user_name" => "david"}, req.cookie_jar) |