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