Enhance test

#623
This commit is contained in:
Artur Beljajev 2018-03-12 12:19:20 +02:00
parent 8de70735f6
commit 6b54dd520d

View file

@ -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