diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-08 18:29:26 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-08 18:29:26 +0200 |
commit | 4b98597edc416d9f26198d7fddc34edadc6092e0 (patch) | |
tree | c31d8e274e79c0eb51bd2c8124f9d6af38b1a704 /spec | |
parent | ce1efb56eb6a8f32ceaa9f9213bf99069e3a9064 (diff) | |
download | gitlab-ce-4b98597edc416d9f26198d7fddc34edadc6092e0.tar.gz |
Add specs for Email confirmation
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/mailers/notify_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 666c6ccefff..4fda3cf908c 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -367,4 +367,28 @@ describe Notify do should have_body_text /#{membership.human_access}/ end end + + describe 'confirmation if email changed' do + let(:example_site_path) { root_path } + let(:user) { create(:user, email: 'old-email@mail.com') } + + before do + user.email = "new-email@mail.com" + user.save + end + + subject { ActionMailer::Base.deliveries.last } + + it 'is sent to the new user' do + should deliver_to 'new-email@mail.com' + end + + it 'has the correct subject' do + should have_subject "Confirmation instructions" + end + + it 'includes a link to the site' do + should have_body_text /#{example_site_path}/ + end + end end |