[rspec-users] Story Runner: DRYing items used in many stories

2007-10-13 Thread Andy Watts
The number of stories I have is growing and I'm writing the following step long hand in each story. Given 'a user named', 'Andy', 'Watts' do |first_name, family_name| @email = first_name + '@test.lan' create_user( :first_name =>

Re: [rspec-users] Story Runner: Readability of output with multiple params

2007-10-13 Thread Andy Watts
Zach Dennis-2 wrote: > > I like to keep them closer to customer readable/writable myself. > Customer readable/writable stories are important for me too. To that end, I would prefer inline, Option 1. 1. And "the user", "Joe", "works for", "Acme", "as a", "janitor" 2. And "the user $user works

Re: [rspec-users] Story Runner: DRYing steps used in many stories

2007-10-13 Thread Andy Watts
Just realized step code is DRY across stories within the same file. (in addition to being DRY across scenarios) I thought it best to organize stories, each in their own separate file. My question then is about shared step code for use in many files. Many Thanks Andy -- View this message in cont

[rspec-users] Story Runner: Two 'then' steps output as 'then..and' :)

2007-10-15 Thread Andy Watts
Maybe I'm slow, but I just noticed that the following code.. When 'I login' When 'I do something else' ...will output as... When 'I login' And 'I do something else' The same is true for two 'Then' steps That is really cool! Reusable steps and coherent English output. - Andy -- View this me

[rspec-users] Story Runner: 'When..Then..Then..Then' stories

2007-10-15 Thread Andy Watts
Maybe I'm slow, but I just noticed that the following code.. Then 'I login' Then 'I do something else' ...will output as... Then 'I login' And 'I do something else' The same is true for two 'When' steps This may have implications for writing reusable steps. I'm finding that 'Then' step imple

Re: [rspec-users] Story Runner: Finally understand when steps are reusable.

2007-10-15 Thread Andy Watts
er 'Then' or a in another 'Then..And'. Similarly, in a 'When..And' scenario, this 'And' is an Event step and is reusable as a 'When' or in another 'When..And'. - Andy David Chelimsky-2 wrote: > > On 10/15/07, Andy Watts

Re: [rspec-users] Scenarios Plugin Pre-Announcement

2007-10-16 Thread Andy Watts
Looks good. I recently spent a lot of time looking at something similar before going with the fixtures replacement plugin. It gives me new_user, create_user, create_user(:first_name => 'overriddefault' ). Also creates records for associations where required. This is useful in story runner, where

Re: [rspec-users] plain text stories

2007-10-22 Thread Andy Watts
This is awesome! Many thanks - Andy David Chelimsky-2 wrote: > > Thanks to discussions on this list, suggestions from many of you and a > patch from Pat Maddox, we now have Plain Text User Stories in Story > Runner. > > Read more: > > http://blog.davidchelimsky.net/articles/2007/10/21/story-

[rspec-users] Working with the response DOM

2007-10-23 Thread Andy Watts
Hi, Anyone know a way to traverse/query the DOM in a response? I'm trying to write reusable story step implementations and as much as possible want to work with the actual response from a previous GET. As an example, I often have buttons that POST/PUT a hidden value. My goal is a reusable step

Re: [rspec-users] Working with the response DOM

2007-10-23 Thread Andy Watts
I completely forgot about Hpricot http://code.whytheluckystiff.net/hpricot/ Looks perfect for this. - Andy Andy Watts wrote: > > Hi, > > Anyone know a way to traverse/query the DOM in a response? > > I'm trying to write reusable story step implementations and as

[rspec-users] Using Mechanize in Story Step Implementations

2007-10-24 Thread Andy Watts
Hi, Thought this might be of interest story writers. The mechanize plugin seems to play nice with RSpec. The following mix of methods seems to work just fine. I especially like the helpers for populating forms. agent = WWW::Mechanize.new page = agent.get 'http://www.gmail.com' page.should have_t

Re: [rspec-users] Working with the response DOM - Step implementations using Hpricot

2007-10-24 Thread Andy Watts
ml > but hadnt asked the question so succinctly > > In that thread, Pat suggests helpers like click_link and submit_form > If you progress along these lines, please post your solution, I'm > very interested. > > linoj > > > On Oct 24, 2007, at 12:43 AM, And

Re: [rspec-users] failing test with nested controller routes

2007-10-27 Thread Andy Watts
Your routes.rb looks funky. Are you running edge rails? It's worthwhile if you're set on restful stuff. I don't think the name_prefix and path_prefix stuff is really necessary. My nested routes read more like map.resources :groups groups.resources :admins end 'rake routes > /tmp/route

[rspec-users] Story runner + selenium-rc + wait_for_xxxx

2008-04-16 Thread Andy Watts
Hi, I've got a story working with selenium-rc, but am stuck writing ajax-aware steps. How are people coding their story steps to wait for an Ajax event to complete? Here's what I've looked at so far. $browser.wait_for_element_present Looks Ideal, but not in selenium-ruby-client-drivers for s

Re: [rspec-users] story runner on restful_authentication question

2008-04-28 Thread Andy Watts
Assuming there's nothing helpful in test.log.. Adding 'debugger' to the misfiring steps may help troubleshoot this.. You'll prolly need to add the following to your helper.rb first. require 'rubygems' require 'ruby-debug' Re-run the story and it should stop at the debugger. Between manually s