aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-02-22 19:37:10 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-02-22 19:44:50 -0300
commit38f347a825cf132b1e0da9402532b40d6ea68522 (patch)
tree45c262774af35fcd1da577ddddee3e50893f18a1
parent1fbfdf5e1bb912d52bfcffb0f6f55d2a6e05f44e (diff)
downloadrails-38f347a825cf132b1e0da9402532b40d6ea68522.tar.gz
rails-38f347a825cf132b1e0da9402532b40d6ea68522.tar.bz2
rails-38f347a825cf132b1e0da9402532b40d6ea68522.zip
Move number_to_human test from AP to AS
Since all changes from #9347 are related to AS, it seems proper that the test is placed there as well.
-rw-r--r--actionpack/test/template/number_helper_test.rb5
-rw-r--r--activesupport/test/number_helper_test.rb7
2 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/test/template/number_helper_test.rb b/actionpack/test/template/number_helper_test.rb
index 6a2d5aef18..d8fffe75ed 100644
--- a/actionpack/test/template/number_helper_test.rb
+++ b/actionpack/test/template/number_helper_test.rb
@@ -266,11 +266,6 @@ class NumberHelperTest < ActionView::TestCase
assert_equal '100&lt;script&gt;&lt;/script&gt;000 Quadrillion', number_to_human(10**20, :delimiter => "<script></script>")
end
- def test_number_to_human_with_custom_units_that_are_missing_the_needed_key
- assert_equal '123', number_to_human(123, :units => {:thousand => 'k'})
- assert_equal '123', number_to_human(123, :units => {})
- end
-
def test_number_to_human_with_custom_format
assert_equal '123 times Thousand', number_to_human(123456, :format => "%n times %u")
volume = {:unit => "ml", :thousand => "lt", :million => "m3"}
diff --git a/activesupport/test/number_helper_test.rb b/activesupport/test/number_helper_test.rb
index 5f54587f93..1fadef3637 100644
--- a/activesupport/test/number_helper_test.rb
+++ b/activesupport/test/number_helper_test.rb
@@ -301,6 +301,13 @@ module ActiveSupport
end
end
+ def test_number_to_human_with_custom_units_that_are_missing_the_needed_key
+ [@instance_with_helpers, TestClassWithClassNumberHelpers, ActiveSupport::NumberHelper].each do |number_helper|
+ assert_equal '123', number_helper.number_to_human(123, units: { thousand: 'k'})
+ assert_equal '123', number_helper.number_to_human(123, units: {})
+ end
+ end
+
def test_number_to_human_with_custom_format
[@instance_with_helpers, TestClassWithClassNumberHelpers, ActiveSupport::NumberHelper].each do |number_helper|
assert_equal '123 times Thousand', number_helper.number_to_human(123456, :format => "%n times %u")