diff options
author | Vipul A M <vipulnsward@gmail.com> | 2014-11-04 12:52:41 +0530 |
---|---|---|
committer | Vipul A M <vipulnsward@gmail.com> | 2015-08-28 11:34:17 +0530 |
commit | 7f23c5d52438f12d7af167a399a77025b1d58a9c (patch) | |
tree | e02e8752146e89548cf31cede51fa5eb474655c2 /activesupport/test | |
parent | 2a6071a5e81cbc3b83625f5e6d5aff61c69f1720 (diff) | |
download | rails-7f23c5d52438f12d7af167a399a77025b1d58a9c.tar.gz rails-7f23c5d52438f12d7af167a399a77025b1d58a9c.tar.bz2 rails-7f23c5d52438f12d7af167a399a77025b1d58a9c.zip |
- Extracted `DELIMITED_REGEX` to `delimited_regex` method and made use of user passed `options[:delimited_regex]` if available. Changed `DELIMITED_REGEX` to `DEFAULT)DELIMITED_REGEX` to signify what it means.
- Added tests for number to delimited and number to currency in both actionview and activesupport.
Changes
Changes
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/number_helper_test.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/test/number_helper_test.rb b/activesupport/test/number_helper_test.rb index cb5230c4eb..944bce1b41 100644 --- a/activesupport/test/number_helper_test.rb +++ b/activesupport/test/number_helper_test.rb @@ -106,6 +106,7 @@ module ActiveSupport assert_equal("123,456,789.78901", number_helper.number_to_delimited(123456789.78901)) assert_equal("0.78901", number_helper.number_to_delimited(0.78901)) assert_equal("123,456.78", number_helper.number_to_delimited("123456.78")) + assert_equal("1,23,456.78", number_helper.number_to_delimited("123456.78", delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/)) assert_equal("123,456.78", number_helper.number_to_delimited("123456.78".html_safe)) end end |