test/failure_app_test.rb in devise-1.3.3 vs test/failure_app_test.rb in devise-1.3.4
- old
+ new
@@ -37,9 +37,14 @@
call_failure
assert_equal 'You need to sign in or sign up before continuing.', @request.flash[:alert]
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]
assert_equal 'http://test.host/users/sign_in', @response.second["Location"]
end