Sha256: f3c5f896cb9401b1c149b0cded38b912a7b390a21048b0ca4f8de0b40c07b1fa
Contents?: true
Size: 797 Bytes
Versions: 47
Compression:
Stored size: 797 Bytes
Contents
require 'rails_helper' RSpec.describe Cmor::Contact::NotifyNewContactRequestJob, type: :job do let(:contact_request) { create(:cmor_contact_contact_request, notified_at: 5.minutes.ago) } describe '#perform' do before(:each) do allow(Cmor::Contact::ContactRequestMailer).to receive_message_chain(:notify, :deliver_now) described_class.new.perform(contact_request.id) end it { expect(Cmor::Contact::ContactRequestMailer).to have_received(:notify) } it { contact_request.reload; expect(contact_request.notified_at).to be_a(Time) } end describe '.perform_later' do before(:each) { described_class.perform_later(contact_request.id) } it { expect(enqueued_jobs.size).to eq(1) } it { expect(enqueued_jobs.last[:job]).to eq(described_class) } end end
Version data entries
47 entries across 47 versions & 1 rubygems