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. This is why I don't mind doing things like adding ids solely for the sake of testing. Testing is good thing to do - there's no shame in making code changes to make tests better. ///ark
_______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users