Re: [rspec-users] get to a different controller

2010-01-07 Thread Zach Dennis
On Thu, Jan 7, 2010 at 5:09 AM, Matt Wynne wrote: > > On 7 Jan 2010, at 07:22, Wincent Colaiuta wrote: > >> El 07/01/2010, a las 03:53, Phillip Koebbe escribió: >> >>> Wincent Colaiuta wrote: Well, there is more than one way to skin a cat, but the thing I like about my proposed solu

Re: [rspec-users] get to a different controller

2010-01-07 Thread Phillip Koebbe
To all involved, Great discussion! Thank you so much for taking the time out of your busy lives to contribute. Please believe me when I say that I appreciate it *very* much! Here is the latest version of my code: http://gist.github.com/269544 I like the idea of shared examples (trying to use th

Re: [rspec-users] get to a different controller

2010-01-07 Thread Andrew Premdas
2010/1/7 Phillip Koebbe > > > Wincent Colaiuta wrote: > >> >> Well, there is more than one way to skin a cat, but the thing I like about >> my proposed solution is that: >> >> - the specification of the behavior appears in the "describe" block that >> corresponds to the controller where the behav

Re: [rspec-users] get to a different controller

2010-01-07 Thread Matt Wynne
On 7 Jan 2010, at 07:22, Wincent Colaiuta wrote: El 07/01/2010, a las 03:53, Phillip Koebbe escribió: Wincent Colaiuta wrote: Well, there is more than one way to skin a cat, but the thing I like about my proposed solution is that: - the specification of the behavior appears in the "desc

Re: [rspec-users] get to a different controller

2010-01-06 Thread Wincent Colaiuta
El 07/01/2010, a las 03:53, Phillip Koebbe escribió: Wincent Colaiuta wrote: Well, there is more than one way to skin a cat, but the thing I like about my proposed solution is that: - the specification of the behavior appears in the "describe" block that corresponds to the controller whe

Re: [rspec-users] get to a different controller

2010-01-06 Thread David Chelimsky
On Wed, Jan 6, 2010 at 8:53 PM, Phillip Koebbe wrote: > > > Wincent Colaiuta wrote: > >> >> Well, there is more than one way to skin a cat, but the thing I like about >> my proposed solution is that: >> >> - the specification of the behavior appears in the "describe" block that >> corresponds to t

Re: [rspec-users] get to a different controller

2010-01-06 Thread Phillip Koebbe
Wincent Colaiuta wrote: Well, there is more than one way to skin a cat, but the thing I like about my proposed solution is that: - the specification of the behavior appears in the "describe" block that corresponds to the controller where the behavior is implemented - but given that the i

Re: [rspec-users] get to a different controller

2010-01-06 Thread Wincent Colaiuta
El 06/01/2010, a las 16:17, Phillip Koebbe escribió: Wincent Colaiuta wrote: I test inherited stuff with shared behaviors. It might be something you could use here. Basically, I have a bunch of behavior in my ApplicationController, for example, and in my spec/controllers/ application_co

Re: [rspec-users] get to a different controller

2010-01-06 Thread Phillip Koebbe
Wincent Colaiuta wrote: I test inherited stuff with shared behaviors. It might be something you could use here. Basically, I have a bunch of behavior in my ApplicationController, for example, and in my spec/controllers/application_controller_spec.rb file I have a bunch of blocks like this

Re: [rspec-users] get to a different controller

2010-01-05 Thread David Chelimsky
On Tue, Jan 5, 2010 at 6:44 PM, Wincent Colaiuta wrote: > El 05/01/2010, a las 21:52, Phillip Koebbe escribió: > > > Pat Maddox wrote: >> >>> The spec has Admin::BaseController as the described type. So of course >>> it's going to test against that. If you want to test a different class, you >

Re: [rspec-users] get to a different controller

2010-01-05 Thread Wincent Colaiuta
El 05/01/2010, a las 21:52, Phillip Koebbe escribió: Pat Maddox wrote: The spec has Admin::BaseController as the described type. So of course it's going to test against that. If you want to test a different class, you need to describe that instead! Hi Pat, Right. But, I'm not really wan

Re: [rspec-users] get to a different controller

2010-01-05 Thread David Chelimsky
On Tue, Jan 5, 2010 at 2:53 PM, Phillip Koebbe wrote: > Subclass it in your spec with >> >> class TestController < Admin::BaseController >> def index >> end >> end >> >> ...then use the TestController in your tests for Admin::BaseController. >> >> That might mean you'll need to add special rou

Re: [rspec-users] get to a different controller

2010-01-05 Thread Phillip Koebbe
Subclass it in your spec with class TestController < Admin::BaseController def index end end ...then use the TestController in your tests for Admin::BaseController. That might mean you'll need to add special routing for TestController which is annoying but can be done. Thanks, Matt. Be

Re: [rspec-users] get to a different controller

2010-01-05 Thread Phillip Koebbe
Pat Maddox wrote: The spec has Admin::BaseController as the described type. So of course it's going to test against that. If you want to test a different class, you need to describe that instead! Hi Pat, Right. But, I'm not really wanting to test a different class. My intention is to pu

Re: [rspec-users] get to a different controller

2010-01-05 Thread David Chelimsky
On Tue, Jan 5, 2010 at 1:46 PM, Matt Wynne wrote: > Subclass it in your spec with > > class TestController < Admin::BaseController > def index > end > end > > ...then use the TestController in your tests for Admin::BaseController. > > That might mean you'll need to add special routing for Tes

Re: [rspec-users] get to a different controller

2010-01-05 Thread Matt Wynne
Subclass it in your spec with class TestController < Admin::BaseController def index end end ...then use the TestController in your tests for Admin::BaseController. That might mean you'll need to add special routing for TestController which is annoying but can be done. On 5 Jan 2010,

Re: [rspec-users] get to a different controller

2010-01-05 Thread Pat Maddox
The spec has Admin::BaseController as the described type. So of course it's going to test against that. If you want to test a different class, you need to describe that instead! On Jan 5, 2010, at 9:36 AM, Phillip Koebbe wrote: > I'm trying to implement a base controller that other controller

[rspec-users] get to a different controller

2010-01-05 Thread Phillip Koebbe
I'm trying to implement a base controller that other controllers descend from, and am having a bit of difficulty in testing the sole "feature" of the base controller. http://gist.github.com/269544 In the "not redirecting when user is an admin" context, I keep getting an error that "no action