1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-07 22:45:20 +02:00

Migrate valuations controller to new reconciliation methods

This commit is contained in:
Zach Gollwitzer 2025-07-10 10:31:40 -04:00
parent 25f0c78c47
commit d80cb9f812
19 changed files with 187 additions and 171 deletions

View file

@ -30,6 +30,7 @@ class Account::OverviewFormTest < ActiveSupport::TestCase
)
@account.expects(:update!).with(name: "New Property Name").once
@account.expects(:lock_attr!).with(:name).once
@account.expects(:sync_later).never # Name change should not trigger sync
result = form.save
@ -84,6 +85,7 @@ class Account::OverviewFormTest < ActiveSupport::TestCase
# Simulate a validation error on opening balance update
@account.expects(:update!).with(name: "New Name").once
@account.expects(:lock_attr!).with(:name).once
@account.expects(:set_or_update_opening_balance!).raises(Account::Reconcileable::InvalidBalanceError.new("Cash balance cannot exceed balance"))
@account.expects(:sync_later).never # Should NOT sync if any update fails