mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 16:02:03 +02:00
Create System / Admin payment log
This commit is contained in:
parent
6418924faf
commit
2645654aef
10 changed files with 122 additions and 41 deletions
|
@ -58,6 +58,30 @@ class ProcessPaymentsTaskTest < ActiveSupport::TestCase
|
|||
assert @invoice.paid?
|
||||
end
|
||||
|
||||
def test_attaches_paid_payment_order_to_invoice
|
||||
assert @invoice.unpaid?
|
||||
|
||||
capture_io { run_task }
|
||||
@invoice.reload
|
||||
|
||||
payment_order = @invoice.payment_orders.last
|
||||
assert_equal 'PaymentOrders::SystemPayment', payment_order.type
|
||||
assert payment_order.paid?
|
||||
end
|
||||
|
||||
def test_attaches_failed_payment_order_to_invoice
|
||||
assert @invoice.unpaid?
|
||||
account = accounts(:cash)
|
||||
account.update!(registrar: registrars(:goodnames))
|
||||
|
||||
capture_io { run_task }
|
||||
@invoice.reload
|
||||
|
||||
payment_order = @invoice.payment_orders.last
|
||||
assert_equal 'PaymentOrders::SystemPayment', payment_order.type
|
||||
assert payment_order.failed?
|
||||
end
|
||||
|
||||
def test_output
|
||||
assert_output "Transactions processed: 1\n" do
|
||||
run_task
|
||||
|
@ -75,4 +99,4 @@ class ProcessPaymentsTaskTest < ActiveSupport::TestCase
|
|||
invoice.update!({ account_activity: nil, cancelled_at: nil }.merge(attributes))
|
||||
invoice
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue