Thanks Pat and David. I'm implementing paging (via will_paginate) and thought I should start with a story. I think I grok what you're saying Pat - the stories should only be looking at "externally" visible stuff - i.e. what a real user can see or do.. That's why you consider controller.send("current_user=",..) a bit hacky right?
So to make sure I only have 30 records showing when there's 40 in the db I should definitely be using have_tag.. Tim. On 10/04/2008, Pat Maddox <[EMAIL PROTECTED]> wrote: > > On Wed, Apr 9, 2008 at 7:37 PM, Tim Haines <[EMAIL PROTECTED]> wrote: > > Hi there, > > > > Just want to confirm I have this right. Writing a story, > > assigns[:games].length.should == 30 fails for me complaining > assigns[:games] > > is nil. It seems assigns isn't set for story steps? I've changed this > to > > response.should have_tag(".game", 30). Is this correct? > > > I would say that you shouldn't be trying to test that sort of thing in > a story. The fact that Rails assigns stuff as instance variables in > views is a framework implementation detail, not externally visible > behavior. > > Pat > _______________________________________________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
_______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users