mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Revert earlier commit. Do care about blank passwords, otherwise update_with_password is useless.
This commit is contained in:
parent
490b20a2b5
commit
90c33a4e05
3 changed files with 0 additions and 16 deletions
|
@ -4,7 +4,6 @@
|
|||
* Give scope to the proper model validation
|
||||
|
||||
* enhancements
|
||||
* Do not care about blank passwords on update
|
||||
* Mail views are scoped as well
|
||||
* Added update_with_password for authenticatable
|
||||
* Allow render_with_scope to accept :controller option
|
||||
|
|
|
@ -78,14 +78,6 @@ module Devise
|
|||
end
|
||||
end
|
||||
|
||||
# Overwrite update_attributes to not care for blank passwords.
|
||||
def update_attributes(attributes)
|
||||
[:password, :password_confirmation].each do |k|
|
||||
attributes.delete(k) unless attributes[k].present?
|
||||
end
|
||||
super
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
# Digests the password using the configured encryptor.
|
||||
|
|
|
@ -27,13 +27,6 @@ class AuthenticatableTest < ActiveSupport::TestCase
|
|||
assert_equal salt, user.password_salt
|
||||
end
|
||||
|
||||
test 'should not care about empty password on update' do
|
||||
user = create_user
|
||||
user.update_attributes(:email => "jose.valim+updated@gmail.com", :password => "")
|
||||
user.reload
|
||||
assert_equal user.email, "jose.valim+updated@gmail.com"
|
||||
end
|
||||
|
||||
test 'should generate a base64 hash using SecureRandom for password salt' do
|
||||
ActiveSupport::SecureRandom.expects(:base64).with(15).returns('friendly_token')
|
||||
assert_equal 'friendly_token', new_user.password_salt
|
||||
|
|
Loading…
Reference in a new issue