Commit 4b98597e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add specs for Email confirmation

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent ce1efb56
...@@ -367,4 +367,28 @@ describe Notify do ...@@ -367,4 +367,28 @@ describe Notify do
should have_body_text /#{membership.human_access}/ should have_body_text /#{membership.human_access}/
end end
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 end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment