1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-02 20:15:22 +02:00

Account::Sync model and test fixture simplifications (#968)

* Add sync model

* Fresh fixtures for sync tests

* Sync tests overhaul

* Fix entry tests

* Complete remaining model test updates

* Update system tests

* Update demo data task

* Add system tests back to PR checks

* More simplifications, add empty family to fixtures for easier testing
This commit is contained in:
Zach Gollwitzer 2024-07-10 11:22:59 -04:00 committed by GitHub
parent de5a2e55b3
commit c6bdf49f10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
60 changed files with 929 additions and 1353 deletions

View file

@ -7,8 +7,8 @@ class TransfersTest < ApplicationSystemTestCase
end
test "can create a transfer" do
checking_name = accounts(:checking).name
savings_name = accounts(:savings).name
checking_name = accounts(:depository).name
savings_name = accounts(:credit_card).name
transfer_date = Date.current
click_on "New transaction"
@ -32,15 +32,15 @@ class TransfersTest < ApplicationSystemTestCase
test "can match 2 transactions and create a transfer" do
transfer_date = Date.current
outflow = accounts(:savings).entries.create! \
name: "Outflow from savings account",
outflow = accounts(:depository).entries.create! \
name: "Outflow from checking account",
date: transfer_date,
amount: 100,
currency: "USD",
entryable: Account::Transaction.new
inflow = accounts(:checking).entries.create! \
name: "Inflow to checking account",
inflow = accounts(:credit_card).entries.create! \
name: "Inflow to cc account",
date: transfer_date,
amount: -100,
currency: "USD",
@ -64,7 +64,7 @@ class TransfersTest < ApplicationSystemTestCase
txn = @user.family.entries.reverse_chronological.first
within "#" + dom_id(txn) do
assert_text "Uncategorized"
assert_text txn.account_transaction.category.name || "Uncategorized"
end
transaction_entry_checkbox(txn).check