fix for issues #999: HTTP_ACCEPT=*/* should redirect to the default location

This commit is contained in:
Emanuel Carnevale
2011-04-29 13:22:52 +02:00
committed by José Valim
parent 39b59142ea
commit 6153a52e2d
2 changed files with 8 additions and 1 deletions

View File

@@ -39,6 +39,11 @@ class FailureTest < ActiveSupport::TestCase
assert_equal 'http://test.host/users/sign_in', @response.second['Location']
end
test 'return to the default redirect location for wildcard requests' do
call_failure 'action_dispatch.request.formats' => nil, 'HTTP_ACCEPT' => '*/*'
assert_equal 'http://test.host/users/sign_in', @response.second['Location']
end
test 'uses the proxy failure message as symbol' do
call_failure('warden' => OpenStruct.new(:message => :test))
assert_equal 'test', @request.flash[:alert]