Skip to content

Commit

Permalink
feat: added specs
Browse files Browse the repository at this point in the history
  • Loading branch information
brunomiguelpinto committed Jan 2, 2025
1 parent 635d21d commit f9b4c0d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/services/webhooks/invoices/resynced_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,19 @@

describe '.call' do
it_behaves_like 'creates webhook', 'invoice.resynced', 'invoice'

it 'calls the InvoiceSerializer with integration_customers included' do
serializer_instance = instance_double(V1::InvoiceSerializer)
allow(V1::InvoiceSerializer).to receive(:new).and_return(serializer_instance)
allow(serializer_instance).to receive(:serialize).and_return({})

webhook_service.call

expect(V1::InvoiceSerializer).to have_received(:new).with(
invoice,
root_name: 'invoice',
includes: array_including(:customer, :integration_customers, :subscriptions, :fees, :credits, :applied_taxes)
)
end
end
end

0 comments on commit f9b4c0d

Please sign in to comment.