mirror of
https://github.com/we-promise/sure.git
synced 2026-04-23 14:04:06 +00:00
Transaction transfers, payments, and matching (#883)
* Add transfer model and clean up family snapshot fixtures * Ignore transfers in income and expense snapshots * Add transfer validations * Implement basic transfer matching UI * Fix merge conflicts * Add missing translations * Tweak selection states for transfer types * Add missing i18n translation
This commit is contained in:
33
test/controllers/transfers_controller_test.rb
Normal file
33
test/controllers/transfers_controller_test.rb
Normal file
@@ -0,0 +1,33 @@
|
||||
require "test_helper"
|
||||
|
||||
class TransfersControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
sign_in users(:family_admin)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get new_transfer_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "can create transfers" do
|
||||
assert_difference "Transfer.count", 1 do
|
||||
post transfers_url, params: {
|
||||
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 -> { Transfer.count } => -1, -> { Transaction.count } => 0 do
|
||||
delete transfer_url(transfers(:credit_card_payment))
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user