2019-04-11 08:17:24 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-09 09:55:07 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 11:08:50 -04:00
|
|
|
RSpec.describe Emails::ConfirmService do
|
2017-09-09 09:55:07 -04:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
2017-09-12 11:36:59 -04:00
|
|
|
subject(:service) { described_class.new(user) }
|
2017-09-09 09:55:07 -04:00
|
|
|
|
|
|
|
describe '#execute' do
|
2020-05-18 05:08:12 -04:00
|
|
|
it 'enqueues a background job to send confirmation email again' do
|
2020-10-21 11:10:28 -04:00
|
|
|
email = user.emails.create!(email: 'new@email.com')
|
2020-05-18 05:08:12 -04:00
|
|
|
|
|
|
|
expect { service.execute(email) }.to have_enqueued_job.on_queue('mailers')
|
2017-09-09 09:55:07 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|