added tests

This commit is contained in:
dinsmol 2021-08-18 22:53:05 +03:00
parent 2ff049707d
commit 6f5cd11859
2 changed files with 14 additions and 3 deletions

View file

@ -1,4 +1,5 @@
en:
edit_balance: Edit balance
admin:
accounts:
index:
@ -16,6 +17,3 @@ en:
registrar_name: Registrar
reset_btn: Reset
download_csv_btn: CSV
account:
edit_balance: Edit balance

View file

@ -3,6 +3,7 @@ require 'application_system_test_case'
class AdminAccountsSystemTest < ApplicationSystemTestCase
setup do
sign_in users(:admin)
@account = registrars(:bestnames).cash_account
end
def test_download_accounts
@ -17,4 +18,16 @@ class AdminAccountsSystemTest < ApplicationSystemTestCase
response.headers['Content-Disposition']
assert_not_empty response.body
end
def test_change_account_balance
puts @account.inspect
visit edit_admin_account_path(@account)
assert_button 'Save'
assert_field 'Balance'
fill_in 'Balance', with: '234'
click_on 'Save'
assert_text 'Account has been successfully updated'
assert_text '234'
end
end