Skip to content

Commit e704221

Browse files
committed
Revert "Add more tests (#4970)"
This reverts commit 05bf574.
1 parent 2a6d608 commit e704221

2 files changed

Lines changed: 1 addition & 10 deletions

File tree

lib/devise/models/database_authenticatable.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def password=(new_password)
6565

6666
# Verifies whether a password (ie from sign in) is the user password.
6767
def valid_password?(password)
68+
return false if password.blank?
6869
Devise::Encryptor.compare(self.class, encrypted_password, password)
6970
end
7071

test/models/database_authenticatable_test.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,6 @@ def setup
148148
refute user.valid_password?('654321')
149149
end
150150

151-
test 'should be invalid if the password is nil' do
152-
user = new_user(password: nil)
153-
refute user.valid_password?(nil)
154-
end
155-
156-
test 'should be invalid if the password is blank' do
157-
user = new_user(password: '')
158-
refute user.valid_password?('')
159-
end
160-
161151
test 'should respond to current password' do
162152
assert new_user.respond_to?(:current_password)
163153
end

0 commit comments

Comments
 (0)