[rspec-users] how do i remove duplication from my steps in story runner?

2008-04-22 Thread Perryn Fowler
OK, I'm probably being incredibly dense here I have some steps defined something like this (extremely contrived) example steps_for(:foo) do #snip Given and When steps Then("two nested divs and a image will be displayed") do response.should have_tag("div") do with_tag("div"

Re: [rspec-users] how do i remove duplication from my steps in story runner?

2008-04-22 Thread Rick DeNatale
On Tue, Apr 22, 2008 at 9:36 AM, Perryn Fowler <[EMAIL PROTECTED]> wrote: > OK, I'm probably being incredibly dense here > > I have some steps defined something like this (extremely contrived) example > > > steps_for(:foo) do > > #snip Given and When steps > > Then("two nested divs and a imag

Re: [rspec-users] how do i remove duplication from my steps in story runner?

2008-04-22 Thread Perryn Fowler
> Another attack. > > Then("two nested divs and an? $type will be displayed") do | type | > > response.should have_tag("div") do >with_tag("div") > end > response.should have_tag(type == 'image' ? 'img' : type) > end > Thanks for the cool idea Rick, but unfortunately

Re: [rspec-users] Spec the Application Controller application.rb

2008-04-22 Thread Andy Croll
Pat Maddox wrote: > You can define a controller method on the fly in order to test this > out. I just did a quick experiment to demonstrate it...obviously > modify to suit your needs. Thanks Pat. I think I'm confusing two issues. 1) How to test before filters for something like authentication 2

Re: [rspec-users] Spec the Application Controller application.rb

2008-04-22 Thread Pat Maddox
On Tue, Apr 22, 2008 at 11:19 PM, Andy Croll <[EMAIL PROTECTED]> wrote: > Pat Maddox wrote: > > You can define a controller method on the fly in order to test this > > out. I just did a quick experiment to demonstrate it...obviously > > modify to suit your needs. > > Thanks Pat. > > I think I