mirror of
https://github.com/we-promise/sure.git
synced 2026-04-13 17:14:05 +00:00
Add loan and credit card views (#1268)
* Add loan and credit card views * Lint fix * Clean up overview card markup * Lint fix * Test fix
This commit is contained in:
@@ -1,7 +1,18 @@
|
||||
require "test_helper"
|
||||
|
||||
class LoanTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
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
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user