mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
Add tests for storing request in invoice's irecto records
This commit is contained in:
parent
b7f8d3a0b0
commit
d2bc6cdd86
1 changed files with 10 additions and 1 deletions
|
@ -9,12 +9,21 @@ class DirectoTest < ActiveSupport::TestCase
|
|||
@invoice.update(total: @invoice.account_activity.bank_transaction.sum)
|
||||
@invoice.account_activity.bank_transaction.update(paid_at: Time.zone.now)
|
||||
|
||||
response = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<results>
|
||||
<Result Type="0" Desc="OK" docid="1" doctype="ARVE" submit="Invoices"/>
|
||||
</results>
|
||||
XML
|
||||
|
||||
stub_request(:post, ENV['directo_invoice_url']).with do |request|
|
||||
request.body.include? 'TransactionDate'
|
||||
end
|
||||
end.to_return(status: 200, body: response)
|
||||
|
||||
assert_nothing_raised do
|
||||
Directo.send_receipts
|
||||
end
|
||||
|
||||
assert_not_empty @invoice.directo_records.first.request
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue