title: RSpec allow_any_instance_of does not work within request test
body: <p>I'm new to RSpec, and testing out some webhook test with request type.
  But here even I use <code>allow_any_instance_of</code>, it errors out <code>got 500 instead of 200</code>. I checked every variable with <code>binding.pry</code> but it seems all okay.
  In my opinion, the mocking fails so it returns <code>500</code>.
  Any ideas?</p>
  
  <pre><code>describe "stripe_invoice_created_webhook", type: :request do
  
    let(:card_invoice){ create(:card_invoice, id: invoice.id) }
    let(:invoice){ create(:invoice, payment_account_id: payment_card_account.payment_account_id) }
    let(:payment_card_account){ create(:payment_card_account,
                                       stripe_customer_id: event.data.object.customer) }
    let(:event){ StripeMock.mock_webhook_event('invoice.created', {
      closed: false
    }) }
  
    it 'responds 200 to invoice_created webhook with valid endpoint' do
      allow_any_instance_of(CardInvoice).to receive(:process_invoice_items)
      allow_any_instance_of(CardInvoice).to receive(:process!)
  
      post '/stripe-events', event.as_json
      expect(response.status).to eq 200
      expect{ card_invoice.process_invoice_items }.not_to raise_error
      expect{ card_invoice.process! }.not_to raise_error
    end
  </code></pre>
  
  <p>and the original code is</p>
  
  <pre><code>class InvoiceCreated
    def call(event)
      invoice = event.data.object
  
      # NOTE: Skip if the invoice is closed.
      if invoice.closed == false
        stripe_customer = invoice.customer
        payment_account = PaymentCardAccount.find_by(stripe_customer_id: stripe_customer)
        card_invoice = Invoice.find_card_invoice_in_this_month_within(payment_account: payment_account)
  
        card_invoice.process_invoice_items(stripe_customer: stripe_customer,
                                           event_invoice_id: invoice.id)
        card_invoice.process!(:pending, id: invoice.id)
      end
    end
  end
  </code></pre>