| | 215 | def test_explicit_index |
|---|
| | 216 | pid = "dont_guess" |
|---|
| | 217 | assert_dom_equal( |
|---|
| | 218 | "<input id=\"post_#{pid}_title\" name=\"post[#{pid}][title]\" size=\"30\" type=\"text\" value=\"Hello World\" />", |
|---|
| | 219 | text_field("post","title", {"index"=>pid}) |
|---|
| | 220 | ) |
|---|
| | 221 | |
|---|
| | 222 | assert_dom_equal( |
|---|
| | 223 | "<textarea cols=\"40\" id=\"post_#{pid}_body\" name=\"post[#{pid}][body]\" rows=\"20\">Back to the hill and over it again!</textarea>", |
|---|
| | 224 | text_area("post", "body", {"index"=>pid}) |
|---|
| | 225 | ) |
|---|
| | 226 | assert_dom_equal( |
|---|
| | 227 | "<input checked=\"checked\" id=\"post_#{pid}_secret\" name=\"post[#{pid}][secret]\" type=\"checkbox\" value=\"1\" /><input name=\"post[#{pid}][secret]\" type=\"hidden\" value=\"0\" />", |
|---|
| | 228 | check_box("post", "secret", {"index"=>pid}) |
|---|
| | 229 | ) |
|---|
| | 230 | assert_dom_equal( |
|---|
| | 231 | "<input checked=\"checked\" id=\"post_#{pid}_title_hello_world\" name=\"post[#{pid}][title]\" type=\"radio\" value=\"Hello World\" />", |
|---|
| | 232 | radio_button("post", "title", "Hello World", {"index"=>pid}) |
|---|
| | 233 | ) |
|---|
| | 234 | assert_dom_equal("<input id=\"post_#{pid}_title_goodbye_world\" name=\"post[#{pid}][title]\" type=\"radio\" value=\"Goodbye World\" />", |
|---|
| | 235 | radio_button("post", "title", "Goodbye World", {"index"=>pid}) |
|---|
| | 236 | ) |
|---|
| | 237 | end |
|---|
| | 238 | |
|---|