mirror of
https://github.com/we-promise/sure.git
synced 2026-05-30 07:49:01 +00:00
Merge branch 'main' into feat/goals-v2-architecture
This commit is contained in:
@@ -99,6 +99,13 @@ class AccountTest < ActiveSupport::TestCase
|
||||
assert_equal opening_date, opening_anchor.entry.date
|
||||
end
|
||||
|
||||
test "accountable display names expose singular and group contexts" do
|
||||
assert_equal "Investment", Investment.singular_display_name
|
||||
assert_equal "Investments", Investment.display_name
|
||||
assert_equal "Cash", Depository.singular_display_name
|
||||
assert_equal "Cash", Depository.display_name
|
||||
end
|
||||
|
||||
test "gets short/long subtype label" do
|
||||
investment = Investment.new(subtype: "hsa")
|
||||
account = @family.accounts.create!(
|
||||
|
||||
@@ -56,9 +56,9 @@ class BalanceSheetTest < ActiveSupport::TestCase
|
||||
asset_groups = BalanceSheet.new(@family).assets.account_groups
|
||||
|
||||
assert_equal 3, asset_groups.size
|
||||
assert_equal 1000 + 2000, asset_groups.find { |ag| ag.name == I18n.t("accounts.types.depository") }.total
|
||||
assert_equal 3000, asset_groups.find { |ag| ag.name == I18n.t("accounts.types.investment") }.total
|
||||
assert_equal 5000, asset_groups.find { |ag| ag.name == I18n.t("accounts.types.other_asset") }.total
|
||||
assert_equal 1000 + 2000, asset_groups.find { |ag| ag.name == Depository.display_name }.total
|
||||
assert_equal 3000, asset_groups.find { |ag| ag.name == Investment.display_name }.total
|
||||
assert_equal 5000, asset_groups.find { |ag| ag.name == OtherAsset.display_name }.total
|
||||
end
|
||||
|
||||
test "calculates liability group totals" do
|
||||
@@ -71,8 +71,8 @@ class BalanceSheetTest < ActiveSupport::TestCase
|
||||
liability_groups = BalanceSheet.new(@family).liabilities.account_groups
|
||||
|
||||
assert_equal 2, liability_groups.size
|
||||
assert_equal 1000 + 2000, liability_groups.find { |ag| ag.name == I18n.t("accounts.types.credit_card") }.total
|
||||
assert_equal 3000 + 5000, liability_groups.find { |ag| ag.name == I18n.t("accounts.types.other_liability") }.total
|
||||
assert_equal 1000 + 2000, liability_groups.find { |ag| ag.name == CreditCard.display_name }.total
|
||||
assert_equal 3000 + 5000, liability_groups.find { |ag| ag.name == OtherLiability.display_name }.total
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user