diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-10-25 17:44:17 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-10-25 17:44:17 -0700 |
commit | 450257c95b0ca2c61eca2cefbcb2afd69e90f4a9 (patch) | |
tree | eb4d65a1d3f6a02fd277fa4f78cee31f7d2d19fe /actionpack/test | |
parent | 1d9ab88ee6360f54197ce21624d844425ec627b3 (diff) | |
download | rails-450257c95b0ca2c61eca2cefbcb2afd69e90f4a9.tar.gz rails-450257c95b0ca2c61eca2cefbcb2afd69e90f4a9.tar.bz2 rails-450257c95b0ca2c61eca2cefbcb2afd69e90f4a9.zip |
properly handle lists of lists. Thanks @adrianpike for reporting!
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/form_options_helper_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb index d3e0cc41a9..469718e1bd 100644 --- a/actionpack/test/template/form_options_helper_test.rb +++ b/actionpack/test/template/form_options_helper_test.rb @@ -596,6 +596,15 @@ class FormOptionsHelperTest < ActionView::TestCase ) end + def test_list_of_lists + @post = Post.new + @post.category = "" + assert_dom_equal( + "<select id=\"post_category\" name=\"post[category]\"><option value=\"\">Please select</option>\n<option value=\"\"></option>\n<option value=\"number\">Number</option>\n<option value=\"text\">Text</option>\n<option value=\"boolean\">Yes/No</option></select>", + select("post", "category", [["Number", "number"], ["Text", "text"], ["Yes/No", "boolean"]], :prompt => true, :include_blank => true) + ) + end + def test_select_with_selected_value @post = Post.new @post.category = "<mus>" |