search for: assert_xhtml

Displaying 3 results from an estimated 3 matches for "assert_xhtml".

2009 Mar 26
0
assert2-0.4.6 provides assert_xhtml, an alternative to assert_select
Rubyists: Consider the following monstrosity, coded using assert_select: assert_select "div#logo_box img[src=/0000/0001/logo.gif][alt=My Company]" Now, behold it rewritten to use assert_xhtml: assert_xhtml do div.logo_box! do img :src => /logo.gif$/, :alt => ''My Company'' end end That sample contains more Ruby; it''s not just one big string. Still not convinced? Oh, I forgot the <a> around the <img>! Try this: asse...
2009 Mar 12
0
assert_xhtml - test your HTML by example
Rubies: My quest to get the maximum coverage & diagnostics from the leanest possible tests has reached a new level. This is a Rails functional test on an HTML form: user = users(:Moses) get :edit_user, :id => user.id assert_xhtml do form :action => ''/users'' do fieldset do legend ''Personal Information'' label ''First name'' input :type => ''text'', :name => ''user[first_name]&...
2009 May 05
9
no sql in the controller guideline
hello. i just checked Chad Fowler''s post "20 Rails Development No-No''s" and one guideline caught my attention. it says: "Nothing that looks at all like SQL should go into a controller, view, or helper." it really came as a surprise to me as Rails itself seems to go against such practice by its AR ''conditions'' option, which most of the times