-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This reverts commit 3aedbf0.
- Loading branch information
Showing
2 changed files
with
5 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,9 +117,9 @@ def setup | |
assert_nil user.authenticatable_salt | ||
end | ||
|
||
test 'should set encrypted password to nil if password is nil' do | ||
assert_nil new_user(password: nil).encrypted_password | ||
assert_nil new_user(password: '').encrypted_password | ||
test 'should not generate a hashed password if password is blank' do | ||
assert_blank new_user(password: nil).encrypted_password | ||
assert_blank new_user(password: '').encrypted_password | ||
end | ||
|
||
test 'should hash password again if password has changed' do | ||
|
@@ -307,11 +307,4 @@ def setup | |
] | ||
end | ||
end | ||
|
||
test 'nil password should be invalid if password is set to nil' do | ||
user = User.create(email: "[email protected]", password: "12345678") | ||
user.password = nil | ||
refute user.valid_password?('12345678') | ||
refute user.valid_password?(nil) | ||
end | ||
end |