mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Adding old_password reader method to authenticatable
This commit is contained in:
parent
801722dc87
commit
afab12fa37
2 changed files with 5 additions and 1 deletions
|
@ -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 a new issue