1
0
Fork 0
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:
Carlos Antonio da Silva 2009-12-14 23:25:45 -02:00
parent 801722dc87
commit afab12fa37
2 changed files with 5 additions and 1 deletions

View file

@ -47,7 +47,7 @@ module Devise
extend ClassMethods
extend SessionSerializer
attr_reader :password
attr_reader :password, :old_password
attr_accessor :password_confirmation
end
end

View file

@ -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',