aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-01-04 09:39:38 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-01-04 09:39:38 -0800
commit5708648a77e8081d69e32ba827c8a909876dd3b9 (patch)
tree6cd04fe001c3768134e61780df9c8a9bb19d9d74 /actionpack/test/template
parentcf32a59ed6134d417503448c951b137aeceba81d (diff)
parent6724c8c8879dc41a4cdffc507353d8a114ca8028 (diff)
downloadrails-5708648a77e8081d69e32ba827c8a909876dd3b9.tar.gz
rails-5708648a77e8081d69e32ba827c8a909876dd3b9.tar.bz2
rails-5708648a77e8081d69e32ba827c8a909876dd3b9.zip
Merge pull request #4296 from kuroda/negative_format
Infer currency negative format from positive one.
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/number_helper_i18n_test.rb7
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 ""