Merge remote-tracking branch 'origin/master' into refactor-contact-archivation

This commit is contained in:
Karl Erik Õunapuu 2020-09-16 10:24:55 +03:00
commit ab1fa9064e
No known key found for this signature in database
GPG key ID: C9DD647298A34764
47 changed files with 453 additions and 290 deletions

View file

@ -82,6 +82,25 @@ class ProcessPaymentsTaskTest < ActiveSupport::TestCase
assert payment_order.failed?
end
def test_credits_registrar_account_without_invoice_beforehand
registrar = registrars(:bestnames)
assert_changes -> { registrar.accounts.first.balance } do
run_task
end
assert_changes -> { registrar.invoices.count } do
run_task
end
end
def test_topup_creates_invoice_with_total_of_transactioned_amount
registrar = registrars(:bestnames)
run_task
assert_equal 0.1, registrar.invoices.last.total
end
def test_output
assert_output "Transactions processed: 1\n" do
run_task