2024-06-20 13:32:44 -04:00
|
|
|
require "application_system_test_case"
|
|
|
|
|
|
|
|
class TransfersTest < ApplicationSystemTestCase
|
|
|
|
setup do
|
|
|
|
sign_in @user = users(:family_admin)
|
|
|
|
visit transactions_url
|
|
|
|
end
|
|
|
|
|
|
|
|
test "can create a transfer" do
|
2024-07-10 11:22:59 -04:00
|
|
|
checking_name = accounts(:depository).name
|
|
|
|
savings_name = accounts(:credit_card).name
|
2024-06-20 13:32:44 -04:00
|
|
|
transfer_date = Date.current
|
|
|
|
|
|
|
|
click_on "New transaction"
|
|
|
|
|
|
|
|
# Will navigate to different route in same modal
|
|
|
|
click_on "Transfer"
|
|
|
|
assert_text "New transfer"
|
|
|
|
|
|
|
|
select checking_name, from: "From"
|
|
|
|
select savings_name, from: "To"
|
2025-01-07 09:41:24 -05:00
|
|
|
fill_in "transfer[amount]", with: 500
|
2024-06-20 13:32:44 -04:00
|
|
|
fill_in "Date", with: transfer_date
|
2024-07-01 10:49:43 -04:00
|
|
|
|
2024-06-20 13:32:44 -04:00
|
|
|
click_button "Create transfer"
|
|
|
|
|
2024-07-01 10:49:43 -04:00
|
|
|
within "#entry-group-" + transfer_date.to_s do
|
2025-01-07 09:41:24 -05:00
|
|
|
assert_text "Payment to"
|
2024-06-20 13:32:44 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|