Do not fallback to string on failure app, easier for debugging, closes #1587
This commit is contained in:
parent
b88524027c
commit
477d9fbcba
|
@ -64,7 +64,7 @@ module Devise
|
|||
|
||||
if message.is_a?(Symbol)
|
||||
I18n.t(:"#{scope}.#{message}", :resource_name => scope,
|
||||
:scope => "devise.failure", :default => [message, message.to_s])
|
||||
:scope => "devise.failure", :default => [message])
|
||||
else
|
||||
message.to_s
|
||||
end
|
||||
|
|
|
@ -52,8 +52,8 @@ class FailureTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
test 'uses the proxy failure message as symbol' do
|
||||
call_failure('warden' => OpenStruct.new(:message => :test))
|
||||
assert_equal 'test', @request.flash[:alert]
|
||||
call_failure('warden' => OpenStruct.new(:message => :invalid))
|
||||
assert_equal 'Invalid email or password.', @request.flash[:alert]
|
||||
assert_equal 'http://test.host/users/sign_in', @response.second["Location"]
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue