summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2024-07-18 04:56:20 +0000
committerGo MAEDA <maeda@farend.jp>2024-07-18 04:56:20 +0000
commitee31bf8fe98b83f11523b02601b62791a9b92de9 (patch)
tree1c0bdec1f426b3b7a3a0cdab2a99ddb88eb1af46 /test/unit
parentb374db2fdb9b5555ba91f678bee10a0ffc6b315b (diff)
downloadredmine-ee31bf8fe98b83f11523b02601b62791a9b92de9.tar.gz
redmine-ee31bf8fe98b83f11523b02601b62791a9b92de9.zip
Add an option to render Integer and Float custom fields with thousands delimiters (#39997).
Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@22935 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/lib/redmine/field_format/numeric_format_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/field_format/numeric_format_test.rb b/test/unit/lib/redmine/field_format/numeric_format_test.rb
index db86a0f5c..4e074feea 100644
--- a/test/unit/lib/redmine/field_format/numeric_format_test.rb
+++ b/test/unit/lib/redmine/field_format/numeric_format_test.rb
@@ -60,4 +60,15 @@ class Redmine::NumericFieldFormatTest < ActionView::TestCase
end
end
end
+
+ def test_integer_field_should_format_with_thousands_delimiter
+ field = IssueCustomField.generate!(field_format: 'int', thousands_delimiter: '1')
+ custom_value = CustomValue.new(custom_field: field, customized: Issue.find(1), value: '1234567')
+ to_test = {'en' => '1,234,567', 'de' => '1.234.567', 'fr' => '1 234 567'}
+ to_test.each do |locale, expected|
+ with_locale locale do
+ assert_equal expected, format_object(custom_value, html: false), locale
+ end
+ end
+ end
end