mirror of
https://github.com/Evolix/chexpire.git
synced 2024-05-05 02:05:09 +02:00
Devise send email notifiation async
This commit is contained in:
parent
8ff94076c0
commit
a0cec2aa96
|
@ -39,4 +39,9 @@ class User < ApplicationRecord
|
|||
validates :tos_accepted, acceptance: true
|
||||
|
||||
scope :notifications_disabled, -> { where(notifications_enabled: false) }
|
||||
|
||||
# Devise ActiveJob integration
|
||||
def send_devise_notification(notification, *args)
|
||||
devise_mailer.send(notification, self, *args).deliver_later
|
||||
end
|
||||
end
|
||||
|
|
|
@ -17,7 +17,11 @@ class UsersTest < ApplicationSystemTestCase
|
|||
fill_in("user[password_confirmation]", with: password)
|
||||
check "user[tos_accepted]"
|
||||
|
||||
click_button I18n.t("devise.registrations.new.sign_up")
|
||||
# confirmation email is sent in async
|
||||
perform_enqueued_jobs do
|
||||
click_button I18n.t("devise.registrations.new.sign_up")
|
||||
end
|
||||
assert_performed_jobs 1
|
||||
|
||||
assert_equal root_path, page.current_path
|
||||
user = User.find_by!(email: email, confirmed_at: nil)
|
||||
|
|
Loading…
Reference in a new issue