diff options
author | Tsutomu Kuroda <t-kuroda@oiax.jp> | 2012-01-05 00:23:10 +0900 |
---|---|---|
committer | Tsutomu Kuroda <t-kuroda@oiax.jp> | 2012-01-05 11:08:09 +0900 |
commit | 22f901cc9db4603d775e4e0a96b0775ca08eebce (patch) | |
tree | d2906e6bf7769117e5dc88fdd93cf7bae5b2fb18 /actionpack/test/template | |
parent | d268ef2f6599cd58cc27a8c9f0b9b6649f62e6a2 (diff) | |
download | rails-22f901cc9db4603d775e4e0a96b0775ca08eebce.tar.gz rails-22f901cc9db4603d775e4e0a96b0775ca08eebce.tar.bz2 rails-22f901cc9db4603d775e4e0a96b0775ca08eebce.zip |
Infer currency negative format from positive one.
When a locale file sets the format of the positive
currency value as '%n %u', the default negative
currency format should be '-%n %u'.
Cherry-picked from master (6724c8c8)
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/number_helper_i18n_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/template/number_helper_i18n_test.rb b/actionpack/test/template/number_helper_i18n_test.rb index 5df09b4d3b..d6e9de9555 100644 --- a/actionpack/test/template/number_helper_i18n_test.rb +++ b/actionpack/test/template/number_helper_i18n_test.rb @@ -53,6 +53,13 @@ class NumberHelperTest < ActionView::TestCase assert_equal("-$10.00", number_to_currency(-10)) end end + + def test_number_to_currency_without_currency_negative_format + clean_i18n do + I18n.backend.store_translations 'ts', :number => { :currency => { :format => { :unit => '@', :format => '%n %u' } } } + assert_equal("-10.00 @", number_to_currency(-10, :locale => 'ts')) + end + end def test_number_with_i18n_precision #Delimiter was set to "" |