Name the Overview cards for the figures they actually show (#96, #97, #98)

Merged
JA
3mo ago
+190-55

Closes #96. Closes #97. Closes #98.

Three cards on the loan Overview tab, one of which was wrong about its own number.

#98 is the actual bug

The Interest Rate card read loans.interest_rate — the rate the loan was written at. The
caption on the card immediately beside it, and the Schedule tab's rate-change table, both read the
rate in force today.

So on a variable loan with any recorded rate change, the Overview tab printed two different
interest rates side by side
, and this card was the only surface still quoting origination. Same
shape as #56 and R21: one figure sourced differently from the figures around it.

Also lifted as_of to the top of the partial. It was declared inside the Monthly Payment card,
which renders after the Interest Rate card — so the two could not have shared a reference date
even in principle.

#96 and #97 are labels

CardWasNowWhy
Opening balanceOriginal PrincipalOriginal Loan Balancethe form field that sets it already says "Original loan balance"
RepaymentMonthly PaymentCurrent Monthly Paymentthe figure is current_minimum_payment — today's balance at today's rate

Both keys renamed across all 14 locale files so they stop asserting the old wording. "Current
Monthly Payment" is applied to the Schedule tab too — #15's criterion is that the two tabs never
show different figures for one loan; they must not show different labels for one figure either.

Order is deliberate: the figure was repointed before the label was renamed. Renaming first
would have labelled a stale figure "current" and made the defect harder to see.

Observed to fail

Three mutations, one failure each:

MutationResult
Card reads interest_rate againred
Rename only the Schedule tab's keyred
Delete current_interest_rate from en.ymlred

That third one matters. Rails renders a missing translation as the humanized key — a missing
current_interest_rate comes out as "Current Interest Rate", which is exactly the string the test
looks for. The first version of these tests asserted on text alone and passed against an en.yml
I had accidentally reverted
. Every label assertion now goes through a helper that rejects a
missing translation for the key under test.

That helper is scoped to its own key on purpose: the account page carries an unrelated pre-existing
gap (ui.account.activity_feed.toggle_selection_checkboxes), and a page-wide check would fail on
someone else's problem.

Checks

231 runs, 1,938 assertions, 0 failures across the loan controller, model and system suites.
rubocop clean (2,013 files). Two erb_lint warnings in loans/_form.html.erb are pre-existing on
main, confirmed by running it there, and untouched here.

Not in this PR

#102 — "All time" running to payoff. Planned, and the plan says do not ship it alone: measured
on real balance rows, every future point carries today's balance forward, so extending the axis
draws a flat line across ~93% of a 30-year chart. It needs the forward series first. Folded into
the top-chart tracker (#100) rather than left looking actionable.