[rspec-users] Just trying out cucumber

Andrew Premdas apremdas at gmail.com
Mon Nov 24 21:23:39 EST 2008


You definitely should have an id for your output. One of the really
good things about feature testing is that it helps you identify what
needs to be seen in your output, and by that I don't mean specific
text, but rather a semantic meaning of your output, in this case a
project containing a token. You should be using css id's and/or
classes to identify these things.

This will help you write less brittle features that don't depend on
the content of something, or even worse the label describing it.

HTH

Andrew


2008/11/24 Shane Mingins <smingins at elctech.com>:
>
> On 25/11/2008, at 8:37 AM, Pau Cor wrote:
>
>>
>> I haven't tested that, so it is probably broken. But the point of the
>> regex is to match a div with the id model_attribute (change this if you
>> set ids with a different convention) and it should have the contents
>> "Token MYTOKEN".
>>
>> If you do this, you are verifying what the customer actually sees, which
>> i _generally_ find preferable to verifying some backend thing like a
>> record being written to the database.
>>
>
> Hi Paul
>
> I agree with you.  The thing is that there is no div tag or id that I can
> use to identify it.
>
> I'm not an expert at regexpr .... the output on screen is:
>
> <p>
>  <b>Token:</b>
>  1f68e325fefd2cd99b91e959a033213e3875bcd5
> </p>
>
> So that was why I went with the solution I did.  I guess one option is
> adding an id to it for testing .... but then that could be a fragile
> approach.
>
> Cheers
> Shane
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list