Skip to content

Commit

Permalink
Fix assertions for testing unknown formats using Mime::NullType
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosantoniodasilva committed Dec 19, 2013
1 parent a5434dd commit 9a3c8f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions actionpack/test/dispatch/request_test.rb
Expand Up @@ -606,7 +606,7 @@ def url_for(options = {})
'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({})
Expand All @@ -624,10 +624,10 @@ def url_for(options = {})
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
Expand Down

0 comments on commit 9a3c8f8

Please sign in to comment.