mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 13:44:47 +02:00
parent
8de70735f6
commit
6b54dd520d
1 changed files with 11 additions and 3 deletions
|
@ -5,12 +5,20 @@ class BalanceTopUpTest < ActionDispatch::IntegrationTest
|
|||
login_as users(:api_bestnames)
|
||||
end
|
||||
|
||||
def test_registrar_balance_top_up
|
||||
def test_creates_new_invoice
|
||||
visit registrar_invoices_url
|
||||
click_link_or_button 'Add deposit'
|
||||
fill_in 'Amount', with: 100
|
||||
click_link_or_button 'Add'
|
||||
fill_in 'Amount', with: '25.5'
|
||||
|
||||
Registry.instance.stub(:vat_rate, 10) do
|
||||
assert_difference 'Invoice.count' do
|
||||
click_link_or_button 'Add'
|
||||
end
|
||||
end
|
||||
|
||||
invoice = Invoice.last
|
||||
|
||||
assert_equal BigDecimal('28.05'), invoice.sum_cache
|
||||
assert_text 'Please pay the following invoice'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue