Re: [rspec-users] Dreading Controller Specs

2008-10-29 Thread Pat Maddox
Jonathan Linowes <[EMAIL PROTECTED]> writes: > On Oct 22, 2008, at 4:32 PM, Pat Maddox wrote: > >> I think any app with a rich domain model benefits from a service layer >> that uses that model. When building Rails apps, stuff is relatively >> simple and the controllers *are* the service layer.

Re: [rspec-users] Dreading Controller Specs

2008-10-28 Thread Jonathan Linowes
On Oct 22, 2008, at 4:32 PM, Pat Maddox wrote: I think any app with a rich domain model benefits from a service layer that uses that model. When building Rails apps, stuff is relatively simple and the controllers *are* the service layer. That's how I think of it, anyway. Most of the time

Re: [rspec-users] Dreading Controller Specs

2008-10-22 Thread Pat Maddox
Matt Wynne <[EMAIL PROTECTED]> writes: > If we assume that the work to be done against the database or other > sub-systems is non-trivial, then we should not directly call the > persistence layer (= Models in Railsspeak) from the Controller, but > delegate that to another class. It seems like Serv

Re: [rspec-users] Dreading Controller Specs

2008-10-22 Thread Matt Wynne
On 21 Oct 2008, at 22:13, Stephen Eley wrote: On Tue, Oct 21, 2008 at 3:57 PM, Rahoul Baruah <[EMAIL PROTECTED]> wrote: * the presenter/service's role is to coordinate the models - so its specs are purely about mocking the associations and the calls inbetween them * the presenter/service i

Re: [rspec-users] Dreading Controller Specs

2008-10-21 Thread Stephen Eley
On Tue, Oct 21, 2008 at 3:57 PM, Rahoul Baruah <[EMAIL PROTECTED]> wrote: > > * the presenter/service's role is to coordinate the models - so its specs > are purely about mocking the associations and the calls inbetween them > * the presenter/service isn't a model (not ActiveRecord::Base) - so it's

Re: [rspec-users] Dreading Controller Specs

2008-10-21 Thread Rahoul Baruah
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 21 Oct 2008, at 16:51, Matt Wynne wrote: Doesn't this just end up shifting the ugly mocking code into the Presenter specs though? The stock answer to this question is to move this logic down into the model layer, so that the interface the P

Re: [rspec-users] Dreading Controller Specs

2008-10-21 Thread Stephen Eley
On Tue, Oct 21, 2008 at 5:45 AM, Rob Lacey <[EMAIL PROTECTED]> wrote: > > However, I seem to dread spec-ing out controllers, they end up being quite > untidy, I think maybe I am approaching them in the wrong way as it probably > shouldn't be as hard as I am making it. For what it's worth, Rob, I'm

Re: [rspec-users] Dreading Controller Specs

2008-10-21 Thread Matt Wynne
On 21 Oct 2008, at 13:08, Rahoul Baruah wrote: On 21 Oct 2008, at 10:45, Rob Lacey wrote: I almost am tempted to simplify the controller by using only the User model and moving most of the checks out of the controller action entirely and putting all into User, although that would mean tha

Re: [rspec-users] Dreading Controller Specs

2008-10-21 Thread Rahoul Baruah
On 21 Oct 2008, at 10:45, Rob Lacey wrote: I almost am tempted to simplify the controller by using only the User model and moving most of the checks out of the controller action entirely and putting all into User, although that would mean that the user model, single_sign_on and music_servi

[rspec-users] Dreading Controller Specs

2008-10-21 Thread Rob Lacey
Hi there, I was look for a little advice really. I've been using RSpec for about 4 months now and I find it an absolute joy for model work and a really nice tool it makes everything so much more readable and nicer to organise However, I seem to dread spec-ing out controllers, they end up bein