mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 05:26:17 +02:00
fixed tests
This commit is contained in:
parent
3409dc37a5
commit
00d97aac06
5 changed files with 17 additions and 1 deletions
|
@ -48,7 +48,7 @@ class BankTransaction < ApplicationRecord
|
||||||
if create_activity(registrar, invoice)
|
if create_activity(registrar, invoice)
|
||||||
payment_order.paid!
|
payment_order.paid!
|
||||||
EisBilling::SendInvoiceStatus.send_info(invoice_number: invoice.number,
|
EisBilling::SendInvoiceStatus.send_info(invoice_number: invoice.number,
|
||||||
status: 'paid')
|
status: 'paid')
|
||||||
else
|
else
|
||||||
payment_order.update(notes: 'Failed to create activity', status: 'failed')
|
payment_order.update(notes: 'Failed to create activity', status: 'failed')
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,6 +21,7 @@ module EisBilling
|
||||||
data[:custom_field1] = invoice.description
|
data[:custom_field1] = invoice.description
|
||||||
data[:custom_field2] = INITIATOR
|
data[:custom_field2] = INITIATOR
|
||||||
data[:invoice_number] = invoice.number
|
data[:invoice_number] = invoice.number
|
||||||
|
data[:reference_number] = invoice.reference_no
|
||||||
|
|
||||||
data
|
data
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,6 +4,12 @@ class BankTransactionTest < ActiveSupport::TestCase
|
||||||
setup do
|
setup do
|
||||||
@registrar = registrars(:bestnames)
|
@registrar = registrars(:bestnames)
|
||||||
@invoice = invoices(:one)
|
@invoice = invoices(:one)
|
||||||
|
|
||||||
|
response_message = {
|
||||||
|
message: 'got it'
|
||||||
|
}
|
||||||
|
stub_request(:post, 'https://eis_billing_system:3000/api/v1/invoice_generator/invoice_status')
|
||||||
|
.to_return(status: 200, body: response_message.to_json, headers: {})
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_matches_against_invoice_nubmber_and_reference_number
|
def test_matches_against_invoice_nubmber_and_reference_number
|
||||||
|
|
|
@ -7,6 +7,9 @@ class AdminAreaBankStatementTest < ApplicationSystemTestCase
|
||||||
|
|
||||||
@invoice = invoices(:one)
|
@invoice = invoices(:one)
|
||||||
Spy.on_instance_method(EisBilling::BaseController, :authorized).and_return(true)
|
Spy.on_instance_method(EisBilling::BaseController, :authorized).and_return(true)
|
||||||
|
response_message = { message: 'got it' }
|
||||||
|
stub_request(:post, 'https://eis_billing_system:3000/api/v1/invoice_generator/invoice_status')
|
||||||
|
.to_return(status: 200, body: response_message.to_json, headers: {})
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_update_bank_statement
|
def test_update_bank_statement
|
||||||
|
|
|
@ -16,6 +16,12 @@ class ProcessPaymentsTaskTest < ActiveJob::TestCase
|
||||||
@account_activity = account_activities(:one)
|
@account_activity = account_activities(:one)
|
||||||
@account = accounts(:cash)
|
@account = accounts(:cash)
|
||||||
|
|
||||||
|
response_message = {
|
||||||
|
message: 'got it'
|
||||||
|
}
|
||||||
|
stub_request(:post, 'https://eis_billing_system:3000/api/v1/invoice_generator/invoice_status')
|
||||||
|
.to_return(status: 200, body: response_message.to_json, headers: {})
|
||||||
|
|
||||||
Setting.registry_iban = beneficiary_iban
|
Setting.registry_iban = beneficiary_iban
|
||||||
|
|
||||||
Lhv::ConnectApi.class_eval do
|
Lhv::ConnectApi.class_eval do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue