mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 21:54:48 +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)
|
login_as users(:api_bestnames)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_registrar_balance_top_up
|
def test_creates_new_invoice
|
||||||
visit registrar_invoices_url
|
visit registrar_invoices_url
|
||||||
click_link_or_button 'Add deposit'
|
click_link_or_button 'Add deposit'
|
||||||
fill_in 'Amount', with: 100
|
fill_in 'Amount', with: '25.5'
|
||||||
click_link_or_button 'Add'
|
|
||||||
|
|
||||||
|
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'
|
assert_text 'Please pay the following invoice'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue