Adding old_password reader method to authenticatable
This commit is contained in:
parent
801722dc87
commit
afab12fa37
|
@ -47,7 +47,7 @@ module Devise
|
|||
extend ClassMethods
|
||||
extend SessionSerializer
|
||||
|
||||
attr_reader :password
|
||||
attr_reader :password, :old_password
|
||||
attr_accessor :password_confirmation
|
||||
end
|
||||
end
|
||||
|
|
|
@ -160,6 +160,10 @@ class AuthenticatableTest < ActiveSupport::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
test 'should respond to old password' do
|
||||
assert new_user.respond_to?(:old_password)
|
||||
end
|
||||
|
||||
test 'should update password with valid old password' do
|
||||
user = create_user
|
||||
assert user.update_with_password(:old_password => '123456',
|
||||
|
|
Loading…
Reference in New Issue