diff options
Diffstat (limited to 'spec/mailers')
-rw-r--r-- | spec/mailers/emails/profile_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/mailers/emails/profile_spec.rb b/spec/mailers/emails/profile_spec.rb index 1c4e4a670b4..88efdbd77be 100644 --- a/spec/mailers/emails/profile_spec.rb +++ b/spec/mailers/emails/profile_spec.rb @@ -416,4 +416,27 @@ RSpec.describe Emails::Profile do is_expected.to have_body_text /#{profile_two_factor_auth_path}/ end end + + describe 'added a new email address' do + let_it_be(:user) { create(:user) } + let_it_be(:email) { create(:email, user: user) } + + subject { Notify.new_email_address_added_email(user, email) } + + it_behaves_like 'an email sent from GitLab' + it_behaves_like 'it should not have Gmail Actions links' + it_behaves_like 'a user cannot unsubscribe through footer link' + + it 'is sent to the user' do + is_expected.to deliver_to user.email + end + + it 'has the correct subject' do + is_expected.to have_subject /^New email address added$/i + end + + it 'includes a link to the email address page' do + is_expected.to have_body_text /#{profile_emails_path}/ + end + end end |