diff options
Diffstat (limited to 'spec/features/profiles/emails_spec.rb')
-rw-r--r-- | spec/features/profiles/emails_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/features/profiles/emails_spec.rb b/spec/features/profiles/emails_spec.rb index 4d2cd0f8b56..a41ef9e86ae 100644 --- a/spec/features/profiles/emails_spec.rb +++ b/spec/features/profiles/emails_spec.rb @@ -31,6 +31,15 @@ describe 'Profile > Emails' do expect(email).to be_nil expect(page).to have_content('Email has already been taken') end + + it 'does not add an invalid email' do + fill_in('Email', with: 'test.@example.com') + click_button('Add email address') + + email = user.emails.find_by(email: email) + expect(email).to be_nil + expect(page).to have_content('Email is invalid') + end end it 'User removes email' do @@ -58,7 +67,7 @@ describe 'Profile > Emails' do email = user.emails.create(email: 'my@email.com') visit profile_emails_path - expect { click_link("Resend confirmation email") }.to change { ActionMailer::Base.deliveries.size } + expect { click_link("Resend confirmation email") }.to have_enqueued_job.on_queue('mailers') expect(page).to have_content("Confirmation email sent to #{email.email}") end |