mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Add start balance to manual accounts (#735)
* Add start_balance to accounts * Add tests * Cleanup * Refactor code and add tests * Update physical cash demo account to be manual * Do not populate start_balance in migration * Cleanup * Review fixes * Revert calc change * Update app/models/exchange_rate.rb Co-authored-by: Zach Gollwitzer <zach.gollwitzer@gmail.com> Signed-off-by: Jakub Kottnauer <jk@jakubkottnauer.com> * Add test * Fix syncable bug and update csv tests --------- Signed-off-by: Jakub Kottnauer <jk@jakubkottnauer.com> Co-authored-by: Zach Gollwitzer <zach.gollwitzer@gmail.com>
This commit is contained in:
@@ -78,4 +78,12 @@ class Account::SyncableTest < ActiveSupport::TestCase
|
||||
|
||||
assert_equal 31, account.balances.count
|
||||
end
|
||||
|
||||
test "account balance is updated after sync" do
|
||||
account = accounts(:savings_with_valuation_overrides)
|
||||
|
||||
assert_changes -> { account.balance }, to: 20500 do
|
||||
account.sync
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user