summaryrefslogtreecommitdiff
path: root/spec/services/emails/confirm_service_spec.rb
blob: e8d3c0d673b95469fb66098daa09cd77089cd299 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Emails::ConfirmService do
  let_it_be(:user) { create(:user) }

  subject(:service) { described_class.new(user) }

  describe '#execute' do
    it 'enqueues a background job to send confirmation email again' do
      email = user.emails.create!(email: 'new@email.com')

      travel_to(10.minutes.from_now) do
        expect { service.execute(email) }.to have_enqueued_job.on_queue('mailers')
      end
    end
  end
end