1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-10 16:05:22 +02:00
This commit is contained in:
Zach Gollwitzer 2025-06-17 18:27:26 -04:00
parent d2c8ea74cf
commit e4a22f81a0

View file

@ -258,12 +258,10 @@ class IncomeStatementTest < ActiveSupport::TestCase
end
test "handles category not found gracefully" do
nonexistent_category = @family.categories.build(name: "Nonexistent")
nonexistent_category.id = 99999
nonexistent_category = Category.new(id: 99999, name: "Nonexistent")
income_statement = IncomeStatement.new(@family)
# Should return 0 for nonexistent category
assert_equal 0, income_statement.median_expense(interval: "month", category: nonexistent_category)
assert_equal 0, income_statement.avg_expense(interval: "month", category: nonexistent_category)
end