Re: [rspec-users] how to spec a recursive method that creates db records?

2009-07-20 Thread Stephen Eley
On Tue, Jul 21, 2009 at 2:05 AM, Barun Singh wrote: > This isn't a question of refactoring; I can > easily refactor the method as you describe but this doesn't resolve the > issue (indeed, it just leads to an increased number of public methods in the > model with no real benefit). Why would they h

Re: [rspec-users] how to spec a recursive method that creates db records?

2009-07-20 Thread Barun Singh
I certainly appreciate the thoughtful and lengthy reply, but I think it misses the main part of my problem -- perhaps my original explanation of my issue was lacking in clarity. This isn't a question of refactoring; I can easily refactor the method as you describe but this doesn't resolve the issu

Re: [rspec-users] My very fist spec file (not sure what's wrong..)

2009-07-20 Thread Stephen Eley
On Mon, Jul 20, 2009 at 11:05 PM, Chris Sund wrote: > > I am finally to the point in the rspec book where it describes how to > implement controller specs, so I thought what the heck, I'll give it a > try. Heh. Points to you for ambition! You might not have realized this (because the RSpec book

Re: [rspec-users] how to spec a recursive method that creates db records?

2009-07-20 Thread Stephen Eley
On Mon, Jul 20, 2009 at 8:33 PM, Barun Singh wrote: > > I want to find a way to write a spec for this method that does both of these > things: > (1)  stub out the do_something method (that method has its own specs) > (2)  not stub out the logic in the else statement, (there is some complex > logic

Re: [rspec-users] My very fist spec file (not sure what's wrong..)

2009-07-20 Thread Ben Mabey
Chris Sund wrote: Hey Everyone, I am finally to the point in the rspec book where it describes how to implement controller specs, so I thought what the heck, I'll give it a try. I have an app I have been working on (Inside out) that I needed to get test specs written for before I continue on wit

Re: [rspec-users] Cucumber step or model spec?

2009-07-20 Thread Jonathan Linowes
On Jul 20, 2009, at 6:58 PM, David Chelimsky wrote: So for me this is not an either/or question. Each underlying component has a responsibility, and the result of the three components doing the right thing adds up to the application behaving correctly. I'd also add that, for me, the cucumber

[rspec-users] My very fist spec file (not sure what's wrong..)

2009-07-20 Thread Chris Sund
Hey Everyone, I am finally to the point in the rspec book where it describes how to implement controller specs, so I thought what the heck, I'll give it a try. I have an app I have been working on (Inside out) that I needed to get test specs written for before I continue on with the app. Now that

[rspec-users] how to spec a recursive method that creates db records?

2009-07-20 Thread Barun Singh
I have a recursive class-level method that I'd like to spec. the logic of it essentially does something like this: def self.mymethod(inputs) If x = x.do_something else mymethod(inputs) end end I want to find a way to write a spec for this method that does both of these things

Re: [rspec-users] Cucumber step or model spec?

2009-07-20 Thread David Chelimsky
On Mon, Jul 20, 2009 at 5:58 PM, David Chelimsky wrote: > On Mon, Jul 20, 2009 at 5:30 PM, Marcelo de Moraes > Serpa wrote: >> Hello list, >> >>  I have an example/spec that relates to the Product#index view and >> says "it should display only the active products". The thing is the >> logic to filt

Re: [rspec-users] Cucumber step or model spec?

2009-07-20 Thread Lee Hambley
Marcelo, My take on this is that if your business user wants to make sure that there are only active products displayed, then it should be in a story. There may be a question about speccing the implementation; however if you are using a named scope - you might argue that you are testing a library

Re: [rspec-users] Cucumber step or model spec?

2009-07-20 Thread David Chelimsky
On Mon, Jul 20, 2009 at 5:30 PM, Marcelo de Moraes Serpa wrote: > Hello list, > >  I have an example/spec that relates to the Product#index view and > says "it should display only the active products". The thing is the > logic to filter the active products should be in the model, and not on > the v

[rspec-users] Cucumber step or model spec?

2009-07-20 Thread Marcelo de Moraes Serpa
Hello list, I have an example/spec that relates to the Product#index view and says "it should display only the active products". The thing is the logic to filter the active products should be in the model, and not on the view, since the view should be "dumb". I just realized that, and what I thin