From 6f5cd11859542186a6ee0d52a548a1c2ed3ba2fe Mon Sep 17 00:00:00 2001 From: dinsmol Date: Wed, 18 Aug 2021 22:53:05 +0300 Subject: [PATCH] added tests --- config/locales/admin/accounts.en.yml | 4 +--- test/system/admin_area/accounts_test.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/config/locales/admin/accounts.en.yml b/config/locales/admin/accounts.en.yml index d94b1775d..d0e2d115a 100644 --- a/config/locales/admin/accounts.en.yml +++ b/config/locales/admin/accounts.en.yml @@ -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 diff --git a/test/system/admin_area/accounts_test.rb b/test/system/admin_area/accounts_test.rb index 7c8344080..1316e63b6 100644 --- a/test/system/admin_area/accounts_test.rb +++ b/test/system/admin_area/accounts_test.rb @@ -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