2024-02-02 09:05:04 -06:00
|
|
|
require "test_helper"
|
|
|
|
|
|
|
|
class FamilyTest < ActiveSupport::TestCase
|
2024-02-03 13:07:23 -06:00
|
|
|
def setup
|
|
|
|
@dylan_family = families(:dylan_family)
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should have many users" do
|
2024-02-27 12:43:49 -05:00
|
|
|
assert @dylan_family.users.size > 0
|
|
|
|
assert @dylan_family.users.include?(users(:family_admin))
|
2024-02-03 13:07:23 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
test "should have many accounts" do
|
2024-02-27 12:43:49 -05:00
|
|
|
assert @dylan_family.accounts.size > 0
|
2024-02-03 13:07:23 -06:00
|
|
|
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
|
2024-02-02 09:05:04 -06:00
|
|
|
end
|