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

Fix unable to create Deposit entries in investment portfolio (#1125)

* Fix unable to create Deposit entries in investment portfolio

* Add system test for deposit transaction
This commit is contained in:
Tony Vincent 2024-08-25 23:48:46 +02:00 committed by GitHub
parent 52c729dc33
commit e1efe97e6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 1 deletions

View file

@ -150,6 +150,24 @@ class TransactionsTest < ApplicationSystemTestCase
assert_selection_count(0)
end
test "can create deposit transaction for investment account" do
investment_account = accounts(:investment)
transfer_date = Date.current
visit account_path(investment_account)
click_on "New transaction"
select "Deposit", from: "Type"
fill_in "Date", with: transfer_date
fill_in "account_entry[amount]", with: 175.25
click_button "Add transaction"
within "#account_" + investment_account.id do
click_on "Transactions"
end
within "#entry-group-" + transfer_date.to_s do
assert_text "175.25"
end
end
private
def create_transaction(name, date, amount, category: nil, merchant: nil, tags: [])