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/controllers/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/controllers/profiles')
-rw-r--r-- | spec/controllers/profiles/emails_controller_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/controllers/profiles/emails_controller_spec.rb b/spec/controllers/profiles/emails_controller_spec.rb index 00862f12b7e..cf510aa5589 100644 --- a/spec/controllers/profiles/emails_controller_spec.rb +++ b/spec/controllers/profiles/emails_controller_spec.rb @@ -17,4 +17,19 @@ describe Profiles::EmailsController do expect(ActionMailer::Base.deliveries.last.subject).to match "Confirmation instructions" end end + + describe '#resend_confirmation_instructions' do + let(:email_params) { {email: "add_email@example.com" } } + + it 'resends an email confirmation' do + email = user.emails.create(email: 'add_email@example.com') + expect {put(:resend_confirmation_instructions, { id: email })}.to change { ActionMailer::Base.deliveries.size } + expect(ActionMailer::Base.deliveries.last.to).to eq [email_params[:email]] + expect(ActionMailer::Base.deliveries.last.subject).to match "Confirmation instructions" + end + + it 'unable to resend an email confirmation' do + expect {put(:resend_confirmation_instructions, { id: 1 })}.to_not change { ActionMailer::Base.deliveries.size } + end + end end |