1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix assertions for testing unknown formats using Mime::NullType

This commit is contained in:
Carlos Antonio da Silva 2013-12-19 13:49:54 -02:00
parent 553b2a74fa
commit 3b10ad0874

View file

@ -606,7 +606,7 @@ class RequestTest < ActiveSupport::TestCase
'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({})
@ -624,10 +624,10 @@ class RequestTest < ActiveSupport::TestCase
test "format is not nil with unknown format" do
request = stub_request
request.expects(:parameters).at_least_once.returns({ format: :hello })
assert_equal request.format.nil?, true
assert_equal request.format.html?, false
assert_equal request.format.xml?, false
assert_equal request.format.json?, false
assert request.format.nil?
assert_not request.format.html?
assert_not request.format.xml?
assert_not request.format.json?
end
test "formats with xhr request" do