mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
Add currency validation to account, update demo data generator (#996)
* Add currency validation to account, update demo data generator * Fix tests
This commit is contained in:
parent
ef0f910b9b
commit
b200b71284
6 changed files with 44 additions and 27 deletions
|
@ -84,6 +84,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_difference [ "Account.count", "Account::Valuation.count", "Account::Entry.count" ], 1 do
|
||||
post accounts_path, params: {
|
||||
account: {
|
||||
name: "Test",
|
||||
accountable_type: "Depository",
|
||||
balance: 200,
|
||||
currency: "USD",
|
||||
|
@ -101,6 +102,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_difference -> { Account.count } => 1, -> { Account::Valuation.count } => 2 do
|
||||
post accounts_path, params: {
|
||||
account: {
|
||||
name: "Test",
|
||||
accountable_type: "Depository",
|
||||
balance: 200,
|
||||
currency: "USD",
|
||||
|
|
|
@ -88,7 +88,7 @@ class TransactionsControllerTest < ActionDispatch::IntegrationTest
|
|||
test "transaction count represents filtered total" do
|
||||
family = families(:empty)
|
||||
sign_in family.users.first
|
||||
account = family.accounts.create! name: "Test", balance: 0, accountable: Depository.new
|
||||
account = family.accounts.create! name: "Test", balance: 0, currency: "USD", accountable: Depository.new
|
||||
|
||||
3.times do
|
||||
create_transaction(account: account)
|
||||
|
@ -110,7 +110,7 @@ class TransactionsControllerTest < ActionDispatch::IntegrationTest
|
|||
test "can paginate" do
|
||||
family = families(:empty)
|
||||
sign_in family.users.first
|
||||
account = family.accounts.create! name: "Test", balance: 0, accountable: Depository.new
|
||||
account = family.accounts.create! name: "Test", balance: 0, currency: "USD", accountable: Depository.new
|
||||
|
||||
11.times do
|
||||
create_transaction(account: account)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue