Skip to content

Commit d6793de

Browse files
authored
Fix import configuration form so number format is applied (#1923)
* Fix number format form error when loading import * Add test to verify import configuration was properly applied
1 parent e771c8c commit d6793de

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

app/controllers/import/configurations_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def import_params
3535
:notes_col_label,
3636
:currency_col_label,
3737
:date_format,
38+
:number_format,
3839
:signage_convention
3940
)
4041
end

test/controllers/import/configurations_controller_test.rb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,24 @@ class Import::ConfigurationsControllerTest < ActionDispatch::IntegrationTest
2323
tags_col_label: "Tags",
2424
amount_col_label: "Amount",
2525
signage_convention: "inflows_positive",
26-
account_col_label: "Account"
26+
account_col_label: "Account",
27+
number_format: "1.234,56"
2728
}
2829
}
2930

3031
assert_redirected_to import_clean_url(@import)
3132
assert_equal "Import configured successfully.", flash[:notice]
33+
34+
# Verify configurations were saved
35+
@import.reload
36+
assert_equal "Date", @import.date_col_label
37+
assert_equal "%Y-%m-%d", @import.date_format
38+
assert_equal "Name", @import.name_col_label
39+
assert_equal "Category", @import.category_col_label
40+
assert_equal "Tags", @import.tags_col_label
41+
assert_equal "Amount", @import.amount_col_label
42+
assert_equal "inflows_positive", @import.signage_convention
43+
assert_equal "Account", @import.account_col_label
44+
assert_equal "1.234,56", @import.number_format
3245
end
3346
end

0 commit comments

Comments
 (0)