mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 07:04:47 +02:00
Add a pause at the e-invoice creation
This commit is contained in:
parent
c7298cde0c
commit
dbda76200d
3 changed files with 16 additions and 2 deletions
|
@ -19,6 +19,18 @@ class ReloadBalanceTaskTest < ActiveSupport::TestCase
|
|||
assert_equal reload_amount, invoice.subtotal
|
||||
end
|
||||
|
||||
def test_issues_invoice_when_auto_reload_is_enabled_and_threshold_reached
|
||||
reload_amount = 100
|
||||
registrar = registrar_with_auto_reload_enabled_and_threshold_reached(reload_amount)
|
||||
|
||||
assert_difference -> { registrar.invoices.count } do
|
||||
capture_io { run_task }
|
||||
end
|
||||
|
||||
invoice = registrar.invoices.last
|
||||
assert_equal Time.zone.today, invoice.e_invoice_sent_at.to_date
|
||||
end
|
||||
|
||||
def test_skips_issuing_invoice_when_threshold_is_not_reached
|
||||
registrar = registrar_with_auto_reload_enabled_and_threshold_not_reached
|
||||
|
||||
|
@ -75,4 +87,4 @@ class ReloadBalanceTaskTest < ActiveSupport::TestCase
|
|||
def run_task
|
||||
Rake::Task['registrars:reload_balance'].execute
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue