[rspec-users] Just trying out cucumber

Shane Mingins smingins at elctech.com
Mon Nov 24 01:43:57 EST 2008


Just giving cucumber a trial with a Rails application and was wanting  
some feedback on what I did for my project token that is a system  
generated value ....

   Scenario: Register new project
     Given I am logged in
     And I am on the new project page
     When I fill in "Title" with "My project title"
     And I fill in "Description" with "My project description"
     And I press "Create"
     Then I should see "My project title"
     And I should see "My project description"
     And "Project" "token" should have a value

Then /^"(.*)" "(.*)" should have a value$/ do |model, attribute|
   model = controller.instance_variable_get("@#{model.downcase}")
   model.send(attribute).should_not be_nil

Wasn't too sure how else this should be approached?


Shane Mingins
ELC Technologies (TM)
1921 State Street
Santa Barbara, CA 93101

Phone: +64 4 568 6684
Mobile: +64 21 435 586
Email:  smingins at elctech.com
AIM:     ShaneMingins
Skype: shane.mingins

(866) 863-7365 Tel - Santa Barbara Office
(866) 893-1902 Fax - Santa Barbara Office

+44 020 7504 1346 Tel - London Office
+44 020 7504 1347 Fax - London Office


Privacy and Confidentiality Notice:
The information contained in this electronic mail message is intended  
for the named recipient(s) only. It may contain privileged and  
confidential information. If you are not an intended recipient, you  
must not copy, forward, distribute or take any action in reliance on  
it. If you have received this electronic mail message in

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2423 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081124/7dbd35d9/attachment.bin>

More information about the rspec-users mailing list