mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Remove ConfirmSignupJob
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ConfirmSignupJob < ActiveJob::Base
|
||||
def perform(user_id)
|
||||
user = Spree::User.find user_id
|
||||
Spree::UserMailer.signup_confirmation(user).deliver_now
|
||||
end
|
||||
end
|
||||
@@ -101,7 +101,7 @@ module Spree
|
||||
end
|
||||
|
||||
def send_signup_confirmation
|
||||
ConfirmSignupJob.perform_later(id)
|
||||
Spree::UserMailer.signup_confirmation(self).deliver_later
|
||||
end
|
||||
|
||||
def associate_customers
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe ConfirmSignupJob do
|
||||
let(:user) { create(:user) }
|
||||
|
||||
it "sends a confirmation email to the user" do
|
||||
mail = double(:mail)
|
||||
expect(Spree::UserMailer).to receive(:signup_confirmation).with(user).and_return(mail)
|
||||
expect(mail).to receive(:deliver_now)
|
||||
|
||||
ConfirmSignupJob.perform_now(user.id)
|
||||
end
|
||||
end
|
||||
@@ -111,7 +111,9 @@ describe Spree::User do
|
||||
|
||||
expect do
|
||||
create(:user, confirmed_at: nil).confirm
|
||||
end.to enqueue_job ConfirmSignupJob
|
||||
end.to enqueue_job ActionMailer::DeliveryJob
|
||||
|
||||
expect(enqueued_jobs.last.to_s).to match "signup_confirmation"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user