Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

Fix date-dependent flake in investment_statement_test (#2539)

Jestin Palamuttamf51b24096795
diff --git a/test/models/investment_statement_test.rb b/test/models/investment_statement_test.rb
index 12c34e10f5..d8260a4219 100644
--- a/test/models/investment_statement_test.rb
+++ b/test/models/investment_statement_test.rb
@@ -235,7 +235,9 @@ class InvestmentStatementTest < ActiveSupport::TestCase
end
test "totals aggregate directly from trade entries" do
- period = Period.custom(start_date: Date.current.beginning_of_month, end_date: Date.current)
+ # Use the full current month: a month-to-date period collapses to a single
+ # day on the 1st, which would drop the start_date + 1.day trade below.
+ period = Period.custom(start_date: Date.current.beginning_of_month, end_date: Date.current.end_of_month)
shared_user = users(:new_email)
investment_account = create_investment_account(balance: 500)
hidden_account = create_investment_account(balance: 500)