Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #4735: radio_button_index_option_test_patch.diff

File radio_button_index_option_test_patch.diff, 0.7 kB (added by charles.dupont@vanderbilt.edu, 2 years ago)

Unit tests for radio_button using index option.

  • actionpack/test/template/form_helper_test.rb

    old new  
    115115    ) 
    116116  end 
    117117 
     118  def test_radio_button_with_index 
     119    assert_dom_equal('<input id="post_1_title_foo_bar" name="post[1][title]" type="radio" value="Foo Bar" />', 
     120      radio_button("post", "title", "Foo Bar", {"index"=>1}) 
     121    ) 
     122  end 
     123 
    118124  def test_radio_button_is_checked_with_integers 
    119125    assert_dom_equal('<input checked="checked" id="post_secret_1" name="post[secret]" type="radio" value="1" />', 
    120126      radio_button("post", "secret", "1")