diff options
author | Brett Walker <brett@digitalmoksha.com> | 2017-09-09 15:55:07 +0200 |
---|---|---|
committer | Brett Walker <brett@digitalmoksha.com> | 2017-09-23 15:23:11 +0200 |
commit | cf8a5bcaec99cc197ff556793febb8317e1db220 (patch) | |
tree | 0c709b59f04d02eb572f01aca2caf059336bffeb /spec/features/profiles | |
parent | c56208f98028d10f8f2ab315ae52e9fcacc45399 (diff) | |
download | gitlab-ce-cf8a5bcaec99cc197ff556793febb8317e1db220.tar.gz |
add verified/unverified labels to profile emails.
added "Resend confirmation email" for unverified emails
Diffstat (limited to 'spec/features/profiles')
-rw-r--r-- | spec/features/profiles/emails_spec.rb | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/spec/features/profiles/emails_spec.rb b/spec/features/profiles/emails_spec.rb index 98b8c607cb0..a3e3ea4e7a2 100644 --- a/spec/features/profiles/emails_spec.rb +++ b/spec/features/profiles/emails_spec.rb @@ -17,8 +17,8 @@ feature 'Profile > Emails' do click_button('Add email address') expect(page).to have_content('my@email.com Unverified') - expect(page).to have_content('user1@example.org Verified') - expect(page).to have_content('Resend Confirmation Email') + expect(page).to have_content("#{user.email} Verified") + expect(page).to have_content('Resend confirmation email') end scenario 'does not add a duplicate email' do @@ -43,14 +43,30 @@ feature 'Profile > Emails' do scenario 'User confirms email' do email = user.emails.create(email: 'my@email.com') visit profile_emails_path - expect(page).to have_content("my@email.com Unverified") + expect(page).to have_content("#{email.email} Unverified") email.confirm expect(email.confirmed?).to be_truthy visit profile_emails_path - expect(page).to have_content("my@email.com Verified") + expect(page).to have_content("#{email.email} Verified") + end + + scenario 'User re-sends confirmation email' 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(page).to have_content("Confirmation email sent to #{email.email}") + end + + scenario 'old unconfirmed emails show Send Confirmation button' do + email = user.emails.create(email: 'my@email.com') + email.update_attribute(:confirmation_sent_at, nil) + visit profile_emails_path + + expect(page).to_not have_content('Resend confirmation email') + expect(page).to have_content('Send confirmation email') end - scenario '' end |