Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Walker <brett@digitalmoksha.com>2017-09-09 16:55:07 +0300
committerBrett Walker <brett@digitalmoksha.com>2017-09-23 16:23:11 +0300
commitcf8a5bcaec99cc197ff556793febb8317e1db220 (patch)
tree0c709b59f04d02eb572f01aca2caf059336bffeb /spec/controllers/profiles
parentc56208f98028d10f8f2ab315ae52e9fcacc45399 (diff)
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.rb15
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