mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Fix [1018]: Add Date field when entering Account Balance (#1068)
* Add new Date field when creating a new Account * Fix german translation * Update app/controllers/concerns/accountable_resource.rb Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * Add missing opening_balance:date to update_params * Change label text --------- Signed-off-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
0f78f54f90
commit
f8d3678a40
@@ -72,6 +72,27 @@ class AccountTest < ActiveSupport::TestCase
|
||||
assert_equal 1000, opening_anchor.entry.amount
|
||||
end
|
||||
|
||||
test "create_and_sync uses provided opening balance date" do
|
||||
Account.any_instance.stubs(:sync_later)
|
||||
opening_date = Time.zone.today
|
||||
|
||||
account = Account.create_and_sync(
|
||||
{
|
||||
family: @family,
|
||||
name: "Test Account",
|
||||
balance: 1000,
|
||||
currency: "USD",
|
||||
accountable_type: "Depository",
|
||||
accountable_attributes: {}
|
||||
},
|
||||
skip_initial_sync: true,
|
||||
opening_balance_date: opening_date
|
||||
)
|
||||
|
||||
opening_anchor = account.valuations.opening_anchor.first
|
||||
assert_equal opening_date, opening_anchor.entry.date
|
||||
end
|
||||
|
||||
test "gets short/long subtype label" do
|
||||
investment = Investment.new(subtype: "hsa")
|
||||
account = @family.accounts.create!(
|
||||
|
||||
Reference in New Issue
Block a user