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

Version Path
cmor_contact-0.0.51.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.50.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.49.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.48.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.45.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.44.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.43.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.42.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.41.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.40.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.39.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.38.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.37.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.36.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.35.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.34.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.33.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.32.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.31.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb
cmor_contact-0.0.30.pre spec/jobs/cmor/contact/notify_new_contact_request_job_spec.rb