Sha256: f68fdba50fa21176ed520aafd0403948bdf9c3c8d2f8b9dbca0c8f9b4efdc335
Contents?: true
Size: 581 Bytes
Versions: 5
Compression:
Stored size: 581 Bytes
Contents
require 'rails_helper' module Tang describe CreateInvoice do before { StripeMock.start } after { StripeMock.stop } it "creates a new invoice for a subscription" do subscription = FactoryBot.create(:subscription) event = StripeMock.mock_webhook_event('invoice.created', customer: subscription.customer.stripe_id, subscription: subscription.stripe_id) count = Invoice.count invoice = CreateInvoice.call(event) expect(Invoice.count).to eq count + 1 expect(invoice.subscription.id).to eq subscription.id end end end
Version data entries
5 entries across 5 versions & 1 rubygems