mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-15 01:38:07 -05:00
Adding old_password reader method to authenticatable
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user