diff options
author | Rizwan Reza <rizwanreza@gmail.com> | 2010-04-02 14:57:30 +0430 |
---|---|---|
committer | Rizwan Reza <rizwanreza@gmail.com> | 2010-04-02 14:57:30 +0430 |
commit | 0dd3eac967b3dc0225dc4f8b90a3043de54e2fb7 (patch) | |
tree | a3a540e38b1e5f6b36f261ae9b2f0116d1f6e39a /actionpack/test | |
parent | 13e3f9c0ce83900d3d5647899a4cff443689c266 (diff) | |
parent | 3adaef8ae73a3061a9fe4c5e0256d80bc09b1cf4 (diff) | |
download | rails-0dd3eac967b3dc0225dc4f8b90a3043de54e2fb7.tar.gz rails-0dd3eac967b3dc0225dc4f8b90a3043de54e2fb7.tar.bz2 rails-0dd3eac967b3dc0225dc4f8b90a3043de54e2fb7.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/form_tag_helper_test.rb | 6 | ||||
-rw-r--r-- | actionpack/test/template/number_helper_test.rb | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb index 868a35c476..1f26840289 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -158,6 +158,12 @@ class FormTagHelperTest < ActionView::TestCase assert_dom_equal expected, actual end + def test_select_tag_with_array_options + assert_deprecated /array/ do + select_tag "people", ["<option>david</option>"] + end + end + def test_text_area_tag_size_string actual = text_area_tag "body", "hello world", "size" => "20x40" expected = %(<textarea cols="20" id="body" name="body" rows="40">hello world</textarea>) diff --git a/actionpack/test/template/number_helper_test.rb b/actionpack/test/template/number_helper_test.rb index 50c57a5588..a21a1a68e4 100644 --- a/actionpack/test/template/number_helper_test.rb +++ b/actionpack/test/template/number_helper_test.rb @@ -102,6 +102,9 @@ class NumberHelperTest < ActionView::TestCase assert_equal("3268", number_with_precision((32.6751 * 100.00), :precision => 0)) assert_equal("112", number_with_precision(111.50, :precision => 0)) assert_equal("1234567892", number_with_precision(1234567891.50, :precision => 0)) + assert_equal("0", number_with_precision(0, :precision => 0)) + assert_equal("0.00100", number_with_precision(0.001, :precision => 5)) + assert_equal("0.001", number_with_precision(0.00111, :precision => 3)) end def test_number_with_precision_with_custom_delimiter_and_separator @@ -122,11 +125,17 @@ class NumberHelperTest < ActionView::TestCase assert_equal "53", number_with_precision(52.7923, :precision => 2, :significant => true ) assert_equal "9775.00", number_with_precision(9775, :precision => 6, :significant => true ) assert_equal "5.392900", number_with_precision(5.3929, :precision => 7, :significant => true ) + assert_equal "0.0", number_with_precision(0, :precision => 2, :significant => true ) + assert_equal "0", number_with_precision(0, :precision => 1, :significant => true ) + assert_equal "0.0001", number_with_precision(0.0001, :precision => 1, :significant => true ) + assert_equal "0.000100", number_with_precision(0.0001, :precision => 3, :significant => true ) + assert_equal "0.0001", number_with_precision(0.0001111, :precision => 1, :significant => true ) end def test_number_with_precision_with_strip_insignificant_zeros assert_equal "9775.43", number_with_precision(9775.43, :precision => 4, :strip_insignificant_zeros => true ) assert_equal "9775.2", number_with_precision(9775.2, :precision => 6, :significant => true, :strip_insignificant_zeros => true ) + assert_equal "0", number_with_precision(0, :precision => 6, :significant => true, :strip_insignificant_zeros => true ) end def test_number_with_precision_with_significant_true_and_zero_precision |