mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 07:39:39 +02:00
Basic trade and holdings view (#1271)
* Add trade view * Lint fix * Fix stale placeholder variable * Add holding view
This commit is contained in:
parent
f5cb13b42f
commit
4bfe47540d
25 changed files with 387 additions and 68 deletions
|
@ -17,4 +17,14 @@ class Account::HoldingsControllerTest < ActionDispatch::IntegrationTest
|
|||
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "destroys holding and associated entries" do
|
||||
assert_difference -> { Account::Holding.count } => -1,
|
||||
-> { Account::Entry.count } => -1 do
|
||||
delete account_holding_path(@account, @holding)
|
||||
end
|
||||
|
||||
assert_redirected_to account_holdings_path(@account)
|
||||
assert_empty @account.entries.where(entryable: @account.trades.where(security: @holding.security))
|
||||
end
|
||||
end
|
||||
|
|
|
@ -174,7 +174,7 @@ class TransactionsControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_equal 1.day.ago.to_date, transaction.date
|
||||
assert_equal Category.second, transaction.account_transaction.category
|
||||
assert_equal Merchant.second, transaction.account_transaction.merchant
|
||||
assert_equal "Updated note", transaction.account_transaction.notes
|
||||
assert_equal "Updated note", transaction.notes
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue