mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
Multi-step account forms + clearer balance editing (#2427)
* Initial multi-step property form * Improve form structure, add optional tooltip help icons to form fields * Add basic inline alert component * Clean up and improve property form lifecycle * Implement Account status concept * Lint fixes * Remove whitespace * Balance editing, scope updates for account * Passing tests * Fix brakeman warning * Remove stale columns * data constraint tweaks * Redundant property
This commit is contained in:
parent
ba7e8d3893
commit
662f2c04ce
66 changed files with 1036 additions and 427 deletions
|
@ -8,35 +8,24 @@ class ValuationsControllerTest < ActionDispatch::IntegrationTest
|
|||
@entry = entries(:valuation)
|
||||
end
|
||||
|
||||
test "error when valuation already exists for date" do
|
||||
assert_no_difference [ "Entry.count", "Valuation.count" ] do
|
||||
post valuations_url(@entry.account), params: {
|
||||
entry: {
|
||||
account_id: @entry.account_id,
|
||||
amount: 19800,
|
||||
date: @entry.date,
|
||||
currency: "USD"
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
assert_response :unprocessable_entity
|
||||
end
|
||||
|
||||
test "creates entry with basic attributes" do
|
||||
account = accounts(:investment)
|
||||
|
||||
assert_difference [ "Entry.count", "Valuation.count" ], 1 do
|
||||
post valuations_url, params: {
|
||||
entry: {
|
||||
name: "New entry",
|
||||
amount: 10000,
|
||||
amount: account.balance + 100,
|
||||
currency: "USD",
|
||||
date: Date.current,
|
||||
account_id: @entry.account_id
|
||||
date: Date.current.to_s,
|
||||
account_id: account.id
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
created_entry = Entry.order(created_at: :desc).first
|
||||
assert_equal "Manual account value update", created_entry.name
|
||||
assert_equal Date.current, created_entry.date
|
||||
assert_equal account.balance + 100, created_entry.amount_money.to_f
|
||||
|
||||
assert_enqueued_with job: SyncJob
|
||||
|
||||
|
@ -47,7 +36,6 @@ class ValuationsControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_no_difference [ "Entry.count", "Valuation.count" ] do
|
||||
patch valuation_url(@entry), params: {
|
||||
entry: {
|
||||
name: "Updated entry",
|
||||
amount: 20000,
|
||||
currency: "USD",
|
||||
date: Date.current
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue