On Mon, Nov 24, 2008 at 10:35 PM, Mark Wilden <[EMAIL PROTECTED]> wrote: > On Mon, Nov 24, 2008 at 6:56 PM, Pau Cor <[EMAIL PROTECTED]> wrote: >> >> Pau Cor wrote: >> > /\<p\>\s*\<b\>Token\:\<\/b\>\s*[a-f0-9]{40}\s*\<\/p\>/m >> >> On second thought, you might want to make that regex more generic. When >> you refactor your view code (i.e. insert divs, add ids/classes, and get >> rid of the <b> tags--which are evil) then your test won't break. >> >> The customer cares that there is a token, not that the token is in a <p> >> tag and the label is bold. > > Yes, but it's important that the token appear under the Token label. I think > it might be difficult to specify that in a generic way.
I wouldn't use a Regexp to find this. Look into assert_select, or use response.should have_tag (which is a wrapper for assert_select) if you prefer to stay RSpec'y. Peter _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users