[rspec-users] Learning Cucumber

Andrew Premdas apremdas at gmail.com
Fri Nov 14 20:33:38 EST 2008

Generally you can do whatever you want in step as its a ruby file. The
thing to do is use a debugger statement to stop in the step (make sure
there is a line after debugger) and then explore.

In your step the Entity you are referring to is probably a class not a variable



2008/11/14 James Byrne <lists at ruby-forum.com>:
> Andrew Premdas wrote:
>> What you're doing here is writing imperative features. Writing
>> declarative features might be a better alternative. Instead of
> ...
>> Given I am on the new entity page
>>  When I correctly fill in the new entity form
>>  Then I should see a confirmation
>> Then the feature has much less technical stuff in it that
>> 1) Hide the intent
>> 2) Make the story brittle to cosmetic changes, in particular to small
>> rewordings of error messages and confirmations
>> A side effect of this is you need much less regex magic to match your
>> expressions.
> This advice does help. Thank you.
> Is there a way to mix webrat and hard coded steps?  In other words, if I
> have this in my steps file.
> Given /I am on the new entity page/ do
>  visits "/entities/new"
> end
> When /I fill out the form correctly/ do
>  fills_in("Common Name", :with => "My Common Name")
>  fills_in("Legal Name", :with => "My Legal Name")
>  Entity.entity_legal_name = "CORP" # does not work
> end
> Is this possible?
> How do I set the attribute "entity_legal_form" to "CORP" for that
> entity?  I cannot figure out how to reference that entity instance.
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list