1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 23:59:40 +02:00

Set minimum supported date for account entries (#1023)

* Set minimum supported date for account entries

* Fix validation proc

* Fix date input in system tests
This commit is contained in:
Zach Gollwitzer 2024-07-26 10:47:27 -04:00 committed by GitHub
parent 701e17829d
commit 76dd5e57fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 16 additions and 4 deletions

View file

@ -7,6 +7,12 @@ class Account::EntryTest < ActiveSupport::TestCase
@entry = account_entries :transaction
end
test "entry cannot be older than 10 years ago" do
assert_raises ActiveRecord::RecordInvalid do
@entry.update! date: 50.years.ago.to_date
end
end
test "valuations cannot have more than one entry per day" do
existing_valuation = account_entries :valuation