More fixture / model test
This commit is contained in:
parent
2c785a8ee1
commit
7bcb669773
3 changed files with 30 additions and 4 deletions
6
test/fixtures/incomes.yml
vendored
6
test/fixtures/incomes.yml
vendored
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue