Add some model tests #9

Merged
atomaka merged 7 commits from model-tests into main 2023-11-22 21:41:07 -05:00
3 changed files with 30 additions and 4 deletions
Showing only changes of commit 7bcb669773 - Show all commits

View file

@ -17,3 +17,9 @@ excluded:
included: false included: false
amount: 10_000 amount: 10_000
member: one member: one
another_included:
description: Salary
included: true
amount: 10_000.00
member: two

View file

@ -2,6 +2,6 @@ require "test_helper"
class IncomeTest < ActiveSupport::TestCase class IncomeTest < ActiveSupport::TestCase
def test_total def test_total
assert_equal 100_000.00, Income.total assert_equal 110_000.00, Income.total
end end
end end

View file

@ -1,7 +1,27 @@
require "test_helper" require "test_helper"
class MemberTest < ActiveSupport::TestCase class MemberTest < ActiveSupport::TestCase
# test "the truth" do def member
# assert true members(:one)
# end end
def test_income
assert_equal 110_000.00, member.income
end
def test_included_income
assert_equal 100_000.00, member.included_income
end
def test_others_included_income
assert_equal 10_000.00, member.others_included_income
end
def test_burden_percent
assert_equal 0.91, member.burden_percent
end
def test_burden_amount
assert_equal 627.90, member.burden_amount
end
end end