mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 23:59:40 +02:00
* Rename account balance field for clarity `original_balance` and `original_currency` may infer that these values are "original" to the account. In reality, they represent the "current" balance and currency on the account. * Prepare fixture data for account sync testing * Update to new field * Fix conflicts * Remove local schema change
28 lines
679 B
Ruby
28 lines
679 B
Ruby
require "test_helper"
|
|
|
|
class FamilyTest < ActiveSupport::TestCase
|
|
def setup
|
|
@dylan_family = families(:dylan_family)
|
|
end
|
|
|
|
test "should have many users" do
|
|
assert @dylan_family.users.size > 0
|
|
assert @dylan_family.users.include?(users(:family_admin))
|
|
end
|
|
|
|
test "should have many accounts" do
|
|
assert @dylan_family.accounts.size > 0
|
|
end
|
|
|
|
test "should destroy dependent users" do
|
|
assert_difference("User.count", -@dylan_family.users.count) do
|
|
@dylan_family.destroy
|
|
end
|
|
end
|
|
|
|
test "should destroy dependent accounts" do
|
|
assert_difference("Account.count", -@dylan_family.accounts.count) do
|
|
@dylan_family.destroy
|
|
end
|
|
end
|
|
end
|