mirror of
https://github.com/we-promise/sure.git
synced 2026-07-25 11:12:13 +00:00
fix(transactions): show full dates in the categorize wizard (#2633)
The categorize view renders dates with :short (\"%b %d\"), which omits the year — ambiguous when the uncategorized backlog spans more than one year. Use format_date, which renders the family's Settings date format; every selectable format includes the year.
This commit is contained in:
@@ -26,6 +26,19 @@ class Transactions::CategorizesControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "show renders full dates so multi-year lists are unambiguous" do
|
||||
create_transaction(account: @account, name: "Starbucks", date: Date.new(2024, 7, 8))
|
||||
|
||||
get transactions_categorize_url
|
||||
|
||||
assert_response :success
|
||||
# format_date uses the family's date_format preference, every variant of
|
||||
# which includes the year; the previous :short format ("%b %d") did not,
|
||||
# making rows ambiguous when the uncategorized list spans years.
|
||||
expected = Date.new(2024, 7, 8).strftime(@family.date_format)
|
||||
assert_match expected, response.body
|
||||
end
|
||||
|
||||
test "show renders the first group at position 0" do
|
||||
2.times { create_transaction(account: @account, name: "Netflix") }
|
||||
3.times { create_transaction(account: @account, name: "Starbucks") }
|
||||
|
||||
Reference in New Issue
Block a user