FEATURE: Improve UX support for multiple email addresses (#9691)

This commit is contained in:
Dan Ungureanu
2020-06-10 19:11:49 +03:00
committed by GitHub
parent 65dd8e2fa2
commit 5bfe1ee4f1
31 changed files with 686 additions and 138 deletions

View File

@ -261,6 +261,21 @@ describe UsersEmailController do
end
end
describe '#create' do
let(:new_email) { 'bubblegum@adventuretime.ooo' }
it 'has an email token' do
sign_in(user)
expect { post "/u/#{user.username}/preferences/email.json", params: { email: new_email } }
.to change(EmailChangeRequest, :count)
emailChangeRequest = EmailChangeRequest.last
expect(emailChangeRequest.old_email).to eq(nil)
expect(emailChangeRequest.new_email).to eq(new_email)
end
end
describe '#update' do
let(:new_email) { 'bubblegum@adventuretime.ooo' }