1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 05:09:38 +02:00
Maybe/test/models/loan_test.rb

19 lines
479 B
Ruby
Raw Permalink Normal View History

2024-02-02 23:09:35 +00:00
require "test_helper"
class LoanTest < ActiveSupport::TestCase
test "calculates correct monthly payment for fixed rate loan" do
loan_account = Account.create! \
family: families(:dylan_family),
name: "Mortgage Loan",
balance: 500000,
currency: "USD",
accountable: Loan.create!(
interest_rate: 3.5,
term_months: 360,
rate_type: "fixed"
)
assert_equal 2245, loan_account.loan.monthly_payment.amount
end
2024-02-02 23:09:35 +00:00
end