Merge branch 'atomaka/refactor/downcase-test-fix' into 'master'
Slight organization cleanup in users tests Downcasing of the email address actually happens with valid data. See merge request !7
This commit is contained in:
commit
527dc493c6
1 changed files with 6 additions and 6 deletions
|
@ -9,6 +9,12 @@ describe User, type: :model do
|
|||
it 'should be valid' do
|
||||
expect(user).to be_valid
|
||||
end
|
||||
|
||||
it 'should downcase emails' do
|
||||
user.email = 'UPPERCASE@BADMAIL.COM'
|
||||
user.save
|
||||
expect(user.email).to eq('uppercase@badmail.com')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with invalid data' do
|
||||
|
@ -28,12 +34,6 @@ describe User, type: :model do
|
|||
expect(user).to be_invalid
|
||||
end
|
||||
|
||||
it 'should downcase emails' do
|
||||
user.email = 'UPPERCASE@BADMAIL.COM'
|
||||
user.save
|
||||
expect(user.email).to eq('uppercase@badmail.com')
|
||||
end
|
||||
|
||||
it 'should not allow duplicate emails' do
|
||||
original = create(:user)
|
||||
duplicate = build(:user, email: original.email)
|
||||
|
|
Loading…
Reference in a new issue