mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
* Move Transfer to Account namespace * Fix partial resolution due to namespacing plurality * Make category and tag controllers consistent with namespacing convention * Update stale partial reference
33 lines
865 B
Ruby
33 lines
865 B
Ruby
require "test_helper"
|
|
|
|
class Account::TransfersControllerTest < ActionDispatch::IntegrationTest
|
|
setup do
|
|
sign_in users(:family_admin)
|
|
end
|
|
|
|
test "should get new" do
|
|
get new_account_transfer_url
|
|
assert_response :success
|
|
end
|
|
|
|
test "can create transfers" do
|
|
assert_difference "Account::Transfer.count", 1 do
|
|
post account_transfers_url, params: {
|
|
account_transfer: {
|
|
from_account_id: accounts(:checking).id,
|
|
to_account_id: accounts(:savings).id,
|
|
date: Date.current,
|
|
amount: 100,
|
|
currency: "USD",
|
|
name: "Test Transfer"
|
|
}
|
|
}
|
|
end
|
|
end
|
|
|
|
test "can destroy transfer" do
|
|
assert_difference -> { Account::Transfer.count } => -1, -> { Transaction.count } => 0 do
|
|
delete account_transfer_url(account_transfers(:credit_card_payment))
|
|
end
|
|
end
|
|
end
|