Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
olegphenomenon committed Sep 1, 2022
1 parent 3409dc3 commit 00d97aa
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/bank_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def create_internal_payment_record(invoice:, registrar:, channel: nil)
if create_activity(registrar, invoice)
payment_order.paid!
EisBilling::SendInvoiceStatus.send_info(invoice_number: invoice.number,
status: 'paid')
status: 'paid')
else
payment_order.update(notes: 'Failed to create activity', status: 'failed')
end
Expand Down
1 change: 1 addition & 0 deletions app/services/eis_billing/add_deposits.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def parse_invoice
data[:custom_field1] = invoice.description
data[:custom_field2] = INITIATOR
data[:invoice_number] = invoice.number
data[:reference_number] = invoice.reference_no

data
end
Expand Down
6 changes: 6 additions & 0 deletions test/models/bank_transaction_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ class BankTransactionTest < ActiveSupport::TestCase
setup do
@registrar = registrars(:bestnames)
@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

def test_matches_against_invoice_nubmber_and_reference_number
Expand Down
3 changes: 3 additions & 0 deletions test/system/admin_area/bank_statement_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ class AdminAreaBankStatementTest < ApplicationSystemTestCase

@invoice = invoices(:one)
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

def test_update_bank_statement
Expand Down
6 changes: 6 additions & 0 deletions test/tasks/invoices/process_payments_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ class ProcessPaymentsTaskTest < ActiveJob::TestCase
@account_activity = account_activities(:one)
@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

Lhv::ConnectApi.class_eval do
Expand Down

0 comments on commit 00d97aa

Please sign in to comment.