mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00: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:
@@ -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
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ class AccountsTest < ApplicationSystemTestCase
|
||||
select "Chase", from: "Financial institution"
|
||||
fill_in "account[balance]", with: 100.99
|
||||
check "Add a start balance for this account"
|
||||
fill_in "Start date (optional)", with: 10.days.ago.to_date.to_s
|
||||
fill_in "Start date (optional)", with: 10.days.ago.to_date
|
||||
fill_in "Start balance (optional)", with: 95
|
||||
click_button "Add #{humanized_accountable(accountable_type).downcase}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user