Permalink
Browse files

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.
  • Loading branch information...
1 parent 1fbfdf5 commit 38f347a825cf132b1e0da9402532b40d6ea68522 @carlosantoniodasilva carlosantoniodasilva committed Feb 22, 2013
Showing with 7 additions and 5 deletions.
  1. +0 −5 actionpack/test/template/number_helper_test.rb
  2. +7 −0 activesupport/test/number_helper_test.rb
@@ -266,11 +266,6 @@ def test_number_to_human_with_custom_units
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"}
@@ -301,6 +301,13 @@ def test_number_to_human_with_custom_units
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")

0 comments on commit 38f347a

Please sign in to comment.