FEATURE: phase 1 of supporting multiple email addresses

This commit is contained in:
Leo McArdle
2017-04-26 19:47:36 +01:00
committed by Guo Xiang Tan
parent 739794f0cb
commit d0b027d88d
35 changed files with 337 additions and 80 deletions

View File

@ -9,11 +9,10 @@ describe User do
describe 'emails' do
let(:user) { Fabricate.build(:user) }
it { is_expected.to validate_presence_of :email }
describe 'when record has a valid email' do
it "should be valid" do
user.email = 'test@gmail.com'
expect(user).to be_valid
end
end
@ -21,7 +20,9 @@ describe User do
describe 'when record has an invalid email' do
it 'should not be valid' do
user.email = 'test@gmailcom'
expect(user).to_not be_valid
expect(user.errors.messages).to include(:primary_email)
end
end
end