Re: [rspec-users] How much details is enough?

2008-04-18 Thread Chris Parsons
Very nice reply Pat. This would make a great blog post if you get a chance. Thanks Chris On 18 Apr 2008, at 10:15, Pat Maddox wrote: Hey Matt, The ultimate test would be one that is focused on one thing such that the test would - break every time that thing broke - break only when that th

Re: [rspec-users] Testing with has_many associations

2008-04-09 Thread Chris Parsons
On 9 Apr 2008, at 12:22, Andy Croll wrote: > it "should increment quantity when it does find a product" do > > @cart_item1 > .should_receive(:increment_quantity).once.with(:no_args).and_return(2) >@cart.should_receive(:find_item_by_name).twice.with("Brown > Trousers").and_return(nil, @

Re: [rspec-users] Testing with has_many associations

2008-04-09 Thread Chris Parsons
On 9 Apr 2008, at 06:25, Andy Croll wrote: > current = self.items.find_by_name(product.name) You're finding by the CartItem name and passing the product name - it looks like that's drawing a blank match when you're expecting it not to. How about a cart_item_spec.rb: describe CartItem do

Re: [rspec-users] "Why not MockEverthing" or why use fixtures for all tests?

2008-03-18 Thread Chris Parsons
Hi David On 18 Mar 2008, at 08:15, David Schmidt wrote: > Here is his email to me, less his signature as I don't want to make > this personal. I'd like to see what the RSpec user community has to > say in response to his comments, below: [snip email] For me, it basically boils down to: use

Re: [rspec-users] What is your workflow? Or how to use the story runner the right way.

2008-03-04 Thread Chris Parsons
ckly. You also get a free 'focusing tool' (lose sight of where you are? just run the story test and write more specs). Hope this is helpful. Maybe I should write up an extended example as a blog post, including mocking etc, as it seems to come up a lot. Thanks Chris PS: Excuse the s

Re: [rspec-users] fixtures in stories

2008-01-15 Thread Chris Parsons
Hi Ingo, On 15 Jan 2008, at 14:55, Ingo Weiss wrote: > how/where do I load fixtures in stories? Try loading your data up manually using 'Given' blocks: (my_story.txt) Given a user called Bob And a user called Charlie and: (steps.rb) Given "a user called $name" do |name| User.create! :name

Re: [rspec-users] RSpec stories introduction

2008-01-15 Thread Chris Parsons
On 15 Jan 2008, at 09:00, Andreas Axelsson wrote: > I had a bit of trouble with this as well, and here's what I've come > up with: > We use something fairly similar to Andreas' method here. For reference, here's a post from last month by David on how he organises his stories by feature: h

Re: [rspec-users] rails story runner returning a nil response code

2007-11-13 Thread Chris Parsons
On 13 Nov 2007, at 22:17, David Chelimsky wrote: On Nov 13, 2007 4:02 PM, Josh Knowles <[EMAIL PROTECTED]> wrote: On 11/13/07, David Chelimsky <[EMAIL PROTECTED]> wrote: No worries - what do you think about treating controllers the same way in stories that we do in controller examples? I