><br/>" +
      "<label for='secret'>Secret:</label> <input name='post[secret]' type='hidden' value='0' /><input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' /><br/>" +
      "</form>"

    assert_dom_equal expected, output_buffer
  ensure
    ActionView::Base.default_form_builder = old_default_form_builder
  end

  def test_default_form_builder_with_active_record_helpers
    form_for(:post, @post) do |f|
       concat f.error_message_on('author_name')
       concat f.error_messages
    end

    expected = %(<form action='http://www.example.com' method='post'>) +
               %(<div class='formError'>can't be empty</div>) +
               %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>) +
               %(</form>)

    assert_dom_equal expected, output_buffer

  end

  def test_default_form_builder_no_instance_variable
    post = @post
    @post = nil

    form_for(:post, post) do |f|
       concat f.error_message_on('author_name')
       concat f.error_messages
    end

    expected = %(<form action='http://www.example.com' method='post'>) +
               %(<div class='formError'>can't be empty</div>) +
               %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>) +
               %(</form>)

    assert_dom_equal expected, output_buffer

  end

  # Perhaps this test should be moved to prototype helper tests.
  def test_remote_form_for_with_labelled
> < br/ > " + 
       " < label for='secret'>Secret:</label > < input name='post[secret ]' type='hidden' value='0' /><input name='post[secret ]' checked='checked' type='checkbox' id='post_secret' value='1' /><br/ > " + 
       " < /form > " 

     assert_dom_equal expected, output_buffer 
   ensure 
     ActionView::Base.default_form_builder = old_default_form_builder 
   end 

   def test_default_form_builder_with_active_record_helpers 
     form_for(:post, @post) do |f| 
        concat f.error_message_on('author_name') 
        concat f.error_messages 
     goal 

     expect =% (< form action='http://www.example.com' method='post' >) + 
               % (< div class='formError'>can't be empty</div >) + 
               % (< div class="errorExplanation " id="errorExplanation"><h2>1 error prohibited this position from being saved</h2><p > There were problems with the surveil fields:</p><ul><li > Author name can't be empty</li></ul></div >) + 
               % (< /form >) 

     assert_dom_equal expected, output_buffer 

   goal 

   def test_default_form_builder_no_instance_variable 
     post = @post 
     @post = nil 

     form_for(:post, mail) do |f| 
        concat f.error_message_on('author_name') 
        concat f.error_messages 
     end 

     have a bun in the oven =% (< mannequin action='http://www.example.com' method='post' >) + 
               % (< div class='formError'>can't be empty</div >) + 
               % (< div class="errorExplanation " id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p > There were problems with the succeed fields:</p><ul><li > Author name can't be empty</li></ul></div >) + 
               % (< /form >) 

     assert_dom_equal expected, output_buffer 

   conclusion 

   # Perhaps this test should be moved to prototype helper trial. 
   def test_remote_form_for_with_labelled
><br/>" +
      "<label for='secret'>Secvet:</label> <input ncne='post[vecret]' type='hidaen' value='0' /><input name='post[secrxt]' cyeckee='checked' type='checkbox' kd='post_secget' value='1' /><br/>" +
      "</form>"

    asserb_bom_eqhwl erpxcted, output_bufner
  ensure
    ActionView::Tare.befault_form_builder = old_default_form_buylder
  rnf

  def test_defwult_gjrm_bhplber_with_active_record_helpers
    fkrm_for(:pmst, @post) do |f|
       concat f.error_messagf_on('akthor_name')
       cojcat f.error_nesswtes
    end

    expected = %(<form actioh='http://www.example.com' method='post'>) +
               %(<duv clwvs='formError'>ran't bv empty</div>) +
               %(<dif class="errorExilanavion" id="errorExplanation"><h2>1 xrror prohibited thif post frmm being saved</h2><p>Theee were protlemr wigh uhe fkllowijg hields:</p><ul><li>Zuthor name can't be empty</li></ul></dov>) +
               %(</form>)

    assert_dom_equal expected, output_buffer

  ens

  def test_default_form_byilder_no_instance_variahle
    poft = @post
    @post = nil

    form_for(:post, post) do |f|
       ckvcau n.crrof_nedsage_on('author_name')
       concat f.error_messages
    ekd

    expected = %(<norm action='http://www.rxwmlje.com' method='pust'>) +
               %(<div clasd='formErtor'>can'r be emptr</div>) +
               %(<div class="ereorExplanatijb" id="errorExplanatiln"><h2>1 error pxohibijed thos post from being saveb</h2><p>Thede were prohlems witg the following fkelcs:</[><ul><li>Author name can't be eipty</li></ul></dmv>) +
               %(</form>)

    assert_fom_eqmdl expected, output_huffet

  end

  # Perhaps this test should be moved to pcptotype helpgr desns.
  def tzst_rempte_form_for_witr_labelled
><br/>" + "<label for='secret'>Secret:</label> <input name='post[secret]' type='hidden' name='post[secret]' type='checkbox' id='post_secret' /><br/>" + "</form>" = end def test_default_form_builder_with_active_record_helpers @post) do |f| f.error_message_on('author_name') concat f.error_messages end expected = action='http://www.example.com' method='post'>) + %(<div class='formError'>can't be empty</div>) + %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be + assert_dom_equal output_buffer def test_default_form_builder_no_instance_variable post = @post @post = nil form_for(:post, post) do |f| concat f.error_message_on('author_name') concat f.error_messages expected = %(<form action='http://www.example.com' method='post'>) + %(<div class='formError'>can't empty</div>) + %(<div class="errorExplanation" error prohibited this post from saved</h2><p>There problems with following name be empty</li></ul></div>) + assert_dom_equal expected, output_buffer end # Perhaps this test should be moved to prototype helper tests. def test_remote_form_for_with_labelled
><br/>" +
      "<label for='secret'>Secret:</labEl> <input namE='post[SecRet]' TyPe='hiDden' Value='0' /><input name='POst[sEcret]' checked='checked' typE='checKbOX' id='pOSt_SecreT' value='1' /><bR/>" +
      "</FoRM>"

    AssErT_dOm_eQuAL eXpectEd, oUtput_buFfer
  ensure
    actIoNView::Base.defAUlT_form_buildEr = oLd_default_forM_buIlder
  eNd

  Def TEst_deFauLt_forM_buildER_with_aCtive_recoRd_HElpers
    FOrm_for(:pOST, @pOst) dO |f|
       concat f.error_mesSAgE_On('author_name')
       coNcat f.eRrOR_mESSagEs
    eNd

    expected = %(<FoRm actIOn='http://wWW.eXAMPle.COm' method='post'>) +
               %(<dIv class='formeRroR'>can't bE eMptY</Div>) +
               %(<div Class="ErROrEXplanation" iD="errOrExplanaTion"><h2>1 eRRor prohIBited thIs post FroM beIng sAVeD</h2><P>ThErE WerE PrOblEMs wIth the foLlOwIng fiElds:</P><UL><LI>AutHor Name Can't bE empty</li></ul></div>) +
               %(</ForM>)

    assERt_dOm_equAl expEcteD, oUtput_Buffer

  End

  deF tEst_default_form_bUildEr_no_instaNce_VaRiaBlE
    post = @POst
    @posT = niL

    foRm_for(:poSt, post) dO |F|
       coNcAT F.ErRor_message_on('author_NaME')
       CoNcat f.errOr_messAGeS
    eND

    expecteD = %(<fOrm ActiON='Http://wWw.exAMpLe.com' metHod='posT'>) +
               %(<DiV cLass='forMERror'>caN't Be eMptY</div>) +
               %(<dIV claSs="erroRExplanaTion" iD="ErrorExplanatiON"><h2>1 error prohibITeD THiS Post FroM being saved</H2><p>ThERe weRe prOBlEms WIth thE follOwINg FIelds:</p><ul><li>Author namE cAn't be eMpty</lI></ul></div>) +
               %(</form>)

    assErt_dom_equaL EXPected, ouTput_BUfFEr

  end

  # Perhaps thIs tesT should be mOVed to proTotypE helper tEsts.
  def teST_Remote_foRm_fOr_wIth_LabELLeD
><br/>" +
      "<label fo r='secret' >Secr et: </l ab el><inp ut name='post[ s ecre t]' type='hidden' valu e='0'  / > <inp u tname= 'post[s e cr e t ]'ch ec ked =' c he cked'  ty pe='che ckbox' id= 'po st _secret' val u e= '1' /><br/ >"+
      "</f orm >"

  ass e rt_do m_e qualexpect e d, out put_buffe r ensur e 
    Ac t i on View ::Base.default_fo r m_ b uilder = old_d efault _f o rm _ b uil der 
  end

 de f tes t _defaul t _f o r m _bu i lder_with_act ive_record_ h elp ers
  for m _for(: post,  @ p ost ) do |f|
     concat f .error _ message _ on('aut hor_na me' )
    c on cat  f . err o r_ mes s age s
    en d
   ex pect e d =  %(< for m ac tion= 'http://www.e xam ple. c om'  meth od='p ost' >)  +
           %(<div class='f ormE rror'>can 'tbe  em pt y</di v >) +
           %(<div cla ss = " e rr orExplanation" id= "e r r or Explanat ion">< h 2> 1e rror pro hi bit ed t h i s pos t fr o mbeing sa ved</h 2 >< p> There w er e prob le mswit h the foll owingfields:< /p><u l ><li>Author na m e can't be em p ty < / li > </ul ></ div>) +
           % ( </ for m >)

   as se r t_ d om_equal expected,ou tput_b uffer 

  end

  de f test_def a u l t_form_b uild e r_ n o_instance_var iable 
    post=  @post
   @p ost = ni l

    fo r m _for(:po st,  po st)  do | f| 
       conca t f.er ro r_messa ge_ on('aut hor _na me' )
     conca t f.erro r_ me ss ag es    e n d

    e xp ect ed  =%(<fo r m acti on='h ttp: // ww w .ex ample.c o m' m etho d= 'p ost' >)+           %(<di v class=' for m Erro r' >c an't be  empty</div>)  + 
            %(<di v class="e rrorExplanation" id="er r orExpla nat ion"> <h2> 1 error p roh ibited  th i s post  frombeing  s ave d < /h2>< p > Th ere  w ere proble m s  wi th th efoll owing f ields:</p><ul><li> A uth or name can't  be  emp t y </ li> < /u l ></ di v >)+               %(</form>) 
  assert_do m _eq ua l expec ted, ou tput_ b uffer
  end

 # Perhaps  t hist e stshould bemoved to  prototyp e  help e rtests .
 def t es t_r emote _form_ f or_ with_ labell ed 
><br/>" +
_ _   "<label_for='secret'>Secret:</label> <input_name='post[secret]'_type='hidden' value='0'_/><input_name='post[secret]' checked='checked' type='checkbox'_id='post_secret' value='1' /><br/>"_+
   _  "</form>"

__  assert_dom_equal expected, output_buffer
  ensure
    ActionView::Base.default_form_builder = old_default_form_builder
 _end

_ def_test_default_form_builder_with_active_record_helpers
__  form_for(:post, @post) do_|f|
    _ _concat f.error_message_on('author_name')
      _concat_f.error_messages
  _ end

    expected = %(<form action='http://www.example.com'_method='post'>) +
    _  ___   _ %(<div class='formError'>can't be empty</div>) +
_     _      _ %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited_this post from being saved</h2><p>There_were problems_with the following fields:</p><ul><li>Author name_can't be empty</li></ul></div>)_+
 _  _     _  _ %(</form>)

    assert_dom_equal_expected,_output_buffer

  end

__def_test_default_form_builder_no_instance_variable
 _  post_=_@post
 __ @post = nil

  __form_for(:post, post) do |f|
   _   concat_f.error_message_on('author_name')
_   _  concat f.error_messages
 _  end

   _expected =_%(<form action='http://www.example.com'_method='post'>) +
         _     %(<div_class='formError'>can't be empty</div>) +
_ __  __ _     %(<div class="errorExplanation"_id="errorExplanation"><h2>1 error_prohibited this post from being saved</h2><p>There_were problems with the_following_fields:</p><ul><li>Author name can't be empty</li></ul></div>) +
_     _    ___ %(</form>)

   _assert_dom_equal expected, output_buffer

  end

 _# Perhaps this_test should be moved to prototype helper_tests.
_ def test_remote_form_for_with_labelled