From 2fff930794d5a9d9d02fc4f1e7ddcc02e54277eb Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Wed, 22 Nov 2023 18:58:53 -0500 Subject: [PATCH] Add income tests --- test/fixtures/incomes.yml | 22 ++++++++++++++-------- test/models/income_test.rb | 6 +++--- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/test/fixtures/incomes.yml b/test/fixtures/incomes.yml index 7bf8b25..16c5156 100644 --- a/test/fixtures/incomes.yml +++ b/test/fixtures/incomes.yml @@ -1,13 +1,19 @@ # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html -one: - description: MyString - included: false - amount: 9.99 +included_1: + description: Salary + included: true + amount: 85_000.00 member: one -two: - description: MyString +included_2: + description: Salary + included: true + amount: 15_000.00 + member: one + +excluded: + description: Bonus included: false - amount: 9.99 - member: two + amount: 10_000 + member: one diff --git a/test/models/income_test.rb b/test/models/income_test.rb index 0b7dc86..a582f18 100644 --- a/test/models/income_test.rb +++ b/test/models/income_test.rb @@ -1,7 +1,7 @@ require "test_helper" class IncomeTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end + def test_total + assert_equal 100_000.00, Income.total + end end