DEV: Improve specs and handle invalid email token

Follow-up to 7977b09025
This commit is contained in:
Gerhard Schlager
2018-12-11 18:04:07 +01:00
parent 8c227715ae
commit 688755baf2
3 changed files with 24 additions and 5 deletions

View File

@@ -221,6 +221,7 @@ class InvitesController < ApplicationController
def send_activation_email(user)
email_token = user.email_tokens.create(email: user.email)
raise ActiveRecord::RecordInvalid.new(email_token) if !email_token.persisted?
Jobs.enqueue(:critical_user_email,
type: :signup,