@@ -23,7 +23,7 @@ describe SendCheckoutReceiptEmailJob do
 
       SendCheckoutReceiptEmailJob.new(checkout.id).perform
 
-      expect(CheckoutMailer).to have_received(:receipt).with(checkout)
+      expect(CheckoutMailer).to have_received(:receipt).with(checkout.user_email, checkout.plan_id)
       expect(mail_stub).to have_received(:deliver_now)
     end
   end
require "rails_helper"

describe SendCheckoutReceiptEmailJob do
  it_behaves_like 'a Delayed Job that notifies Airbrake about errors'

  describe '.enqueue' do
    it "enqueues a job" do
      checkout = create(:checkout)
      Delayed::Job.stubs(:enqueue)

      SendCheckoutReceiptEmailJob.enqueue(checkout.id)

      expect(Delayed::Job).to have_received(:enqueue).with(
        kind_of(SendCheckoutReceiptEmailJob)
      )
    end
  end

  describe '#perform' do
    it 'sends a checkout receipt' do
      checkout = stubbed_checkout
      mail_stub = stub_mail_method(CheckoutMailer, :receipt)

      SendCheckoutReceiptEmailJob.new(checkout.id).perform

      expect(CheckoutMailer).to have_received(:receipt).with(checkout)
      expect(mail_stub).to have_received(:deliver_now)
    end
  end
end

Line is too long. [99/80]