Handle nil values correctly in User.authenticateUser
This commit is contained in:
parent
241d504a76
commit
1d9856ff93
2 changed files with 7 additions and 1 deletions
|
|
@ -32,6 +32,12 @@ describe User do
|
|||
it 'can not authenticate with incorrect password' do
|
||||
expect(User.authenticate(user.nick, 'foobar')).to be_nil
|
||||
end
|
||||
it 'can not authenticate with nil nick' do
|
||||
expect(User.authenticate(nil, 'blahblah')).to be_nil
|
||||
end
|
||||
it 'can not authenticate with nil password' do
|
||||
expect(User.authenticate(user.nick, nil)).to be_nil
|
||||
end
|
||||
it 'can not set a password without matching confirmation' do
|
||||
user.password = 'abcdefghij'
|
||||
user.password_confirmation = 'foobarxyz'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue