mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 05:25:24 +02:00
Add initial model tests with starter fixtures for User, Family, and Account (#281)
* Add initial user fixture * Add initial tests for the User model * Add initial tests for Family and a valid Account * Pass rubocop
This commit is contained in:
parent
472746df06
commit
69698d0463
6 changed files with 107 additions and 35 deletions
|
@ -1,7 +1,28 @@
|
|||
require "test_helper"
|
||||
|
||||
class FamilyTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
def setup
|
||||
@dylan_family = families(:dylan_family)
|
||||
end
|
||||
|
||||
test "should have many users" do
|
||||
assert_equal 2, @dylan_family.users.size
|
||||
assert @dylan_family.users.include?(users(:bob))
|
||||
end
|
||||
|
||||
test "should have many accounts" do
|
||||
assert_equal 2, @dylan_family.accounts.size
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue