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

Ticket #8775: serialize.diff

File serialize.diff, 1.7 kB (added by mislav, 1 year ago)

failing test case

  • test/unit/form.html

    old new  
    9797      <input type="hidden" name="tf_hidden" /> 
    9898      <input type="password" name="tf_password" /> 
    9999    </div> 
     100 
     101    <div id="brackets"> 
     102      <input name="items[][id]" type="text" value="1" /> 
     103      <input name="items[][quant]" type="text" value="3" /> 
     104      <input name="items[][id]" type="text" value="2" /> 
     105      <input name="items[][quant]" type="text" value="12" /> 
     106    </div> 
    100107  </form> 
    101108 
    102   <form id="form_focus_hidden" style="display: none"> 
     109  <form id="focus_hidden" style="display: none"> 
    103110    <input type="text" /> 
    104111  </form> 
    105112 
     
    298305 
    299306      // Form.Element.activate shouldn't raise an exception when the form or field is hidden 
    300307      assertNothingRaised(function() { 
    301         $('form_focus_hidden').focusFirstElement(); 
     308        $('focus_hidden').focusFirstElement(); 
    302309      }); 
    303310    }}, 
    304311     
     
    375382                      $('form').serialize({ submit: false })); 
    376383      assertHashEqual({ val1:4, action:'blah' }, 
    377384                      $('form').serialize({ submit: 'inexistent' })); 
     385 
     386      // bracket conventions 
     387      assertHashEqual({ items:[{ id:1, quant:3 }, { id:2, quant:12 }] }, Form.serialize('brackets', true)); 
    378388    }}, 
    379389     
    380390    testFormMethodsOnExtendedElements: function() {with(this) { 
     
    400410    }}, 
    401411     
    402412    testFormRequest: function() {with(this) { 
    403       request = $("form").request(); 
     413      var request = $("form").request(); 
    404414      assert($("form").hasAttribute("method")); 
    405415      assert(request.url.include("fixtures/empty.js?val1=4")); 
    406416      assertEqual("get", request.method);