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?<br>
<br>So to make sure I only have 30 records showing when there's 40 in the db I should definitely be using have_tag..<br><br>Tim.<br><br><div><span class="gmail_quote">On 10/04/2008, <b class="gmail_sendername">Pat Maddox</b> <<a href="mailto:pergesu@gmail.com">pergesu@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Wed, Apr 9, 2008 at 7:37 PM, Tim Haines <<a href="mailto:tmhaines@gmail.com">tmhaines@gmail.com</a>> wrote:<br> > Hi there,<br> ><br> > Just want to confirm I have this right. Writing a story,<br> > assigns[:games].length.should == 30 fails for me complaining assigns[:games]<br>
> is nil. It seems assigns isn't set for story steps? I've changed this to<br> > response.should have_tag(".game", 30). Is this correct?<br> <br> <br>I would say that you shouldn't be trying to test that sort of thing in<br>
a story. The fact that Rails assigns stuff as instance variables in<br> views is a framework implementation detail, not externally visible<br> behavior.<br> <br> Pat<br> _______________________________________________<br>
rspec-users mailing list<br> <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br> <a href="http://rubyforge.org/mailman/listinfo/rspec-users">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>
</blockquote></div><br>