failure_app now properly handles nil request.format

This commit is contained in:
José Valim
2010-11-09 23:30:53 +01:00
parent 07fedb4383
commit 505bd39700
2 changed files with 8 additions and 2 deletions

View File

@@ -77,6 +77,11 @@ class FailureTest < ActiveSupport::TestCase
assert_equal 401, @response.first
end
test 'return 401 status for unknown formats' do
call_failure 'formats' => []
assert_equal 401, @response.first
end
test 'return WWW-authenticate headers if model allows' do
call_failure('formats' => :xml)
assert_equal 'Basic realm="Application"', @response.second["WWW-Authenticate"]