Re: [rspec-users] Generated rspec video

2008-02-13 Thread Kero
> > A sneak preview of what I've been doing with my patch that made it > > into rspec 1.1.3: > > > > Stuff for off-list: > > - created with mencoder, I can play with mplayer. > >Reports on success or failure of other players welcome. > > weird codec combo... you should have used thedora or xv

[rspec-users] How to load fixtures for plugins with rspec tests

2008-02-13 Thread lfeistel
Hello all, I had no trouble loading fixtures from the application's base spec/fixtures directory, but I am working on a plugin which has its own rspec tests and fixtures. I am getting the rspec tests to run, but they cannot seem to load the fixtures that go with each plugin, so of course they fai

Re: [rspec-users] How do I mock out the before :login_required method?

2008-02-13 Thread Wes Shaddix
David Chelimsky wrote: > On Feb 13, 2008 6:24 PM, Wes Shaddix <[EMAIL PROTECTED]> wrote: > >> David Chelimsky wrote: >> >> On Feb 13, 2008 6:03 PM, Wes Shaddix <[EMAIL PROTECTED]> wrote: >> >> >> Jarkko Laine wrote: >> >> >> On 13.2.2008, at 5.12, Wes Shaddix wrote: >> >> >> >> I have a Gro

Re: [rspec-users] How do I mock out the before :login_required method?

2008-02-13 Thread David Chelimsky
On Feb 13, 2008 6:24 PM, Wes Shaddix <[EMAIL PROTECTED]> wrote: > > David Chelimsky wrote: > > On Feb 13, 2008 6:03 PM, Wes Shaddix <[EMAIL PROTECTED]> wrote: > > > Jarkko Laine wrote: > > > On 13.2.2008, at 5.12, Wes Shaddix wrote: > > > > I have a GroupController class that inherits from a S

Re: [rspec-users] How do I mock out the before :login_required method?

2008-02-13 Thread Wes Shaddix
David Chelimsky wrote: On Feb 13, 2008 6:03 PM, Wes Shaddix <[EMAIL PROTECTED]> wrote: Jarkko Laine wrote: On 13.2.2008, at 5.12, Wes Shaddix wrote: I have a GroupController class that inherits from a SecuredController which have a before filter (before_filter :login_required).

Re: [rspec-users] How do I mock out the before :login_required method?

2008-02-13 Thread David Chelimsky
On Feb 13, 2008 6:03 PM, Wes Shaddix <[EMAIL PROTECTED]> wrote: > > Jarkko Laine wrote: > > > > On 13.2.2008, at 5.12, Wes Shaddix wrote: > > > >> I have a GroupController class that inherits from a SecuredController > >> which have a before filter (before_filter :login_required). This is > >> usin

Re: [rspec-users] How do I mock out the before :login_required method?

2008-02-13 Thread Wes Shaddix
Jarkko Laine wrote: > > On 13.2.2008, at 5.12, Wes Shaddix wrote: > >> I have a GroupController class that inherits from a SecuredController >> which have a before filter (before_filter :login_required). This is >> using the restul authentication system. I want to mock out the >> login_required met

Re: [rspec-users] How do I mock out the before :login_required method?

2008-02-13 Thread David Chelimsky
On Feb 13, 2008 6:52 AM, Max Williams <[EMAIL PROTECTED]> wrote: > > I'm having a similar problem - my application controller has the UserSystem > module included, and that's where the login_required method lives. In a > spec for another controller, which has before_filter :login_required, i'm > t

Re: [rspec-users] How do I mock out the before :login_required method?

2008-02-13 Thread Max Williams
I'm having a similar problem - my application controller has the UserSystem module included, and that's where the login_required method lives. In a spec for another controller, which has before_filter :login_required, i'm trying to stub the login_required method to just return true, but i think m

Re: [rspec-users] Example controller spec no worky?

2008-02-13 Thread Brad Carson
> I was led to believe Rails automatically handled RecordNotFounds with a > 404, meaning I didn't have to catch them myself. > > I made sure requests weren't considered local in the test environment to > trigger the 404 page instead of the debug info. I tried putting a > rescue_action_in_publ

Re: [rspec-users] Example controller spec no worky?

2008-02-13 Thread Brad Carson
Jarkko Laine wrote: > On 13.2.2008, at 21.09, Brad Carson <[EMAIL PROTECTED]> wrote: > >> - should not assign an event (ERROR - 3) >> >> ActiveRecord::RecordNotFound in 'EventsController attempt to show >> non-existing event should render 404' >> ActiveRecord::RecordNotFound >> >> Mind-boggling. >

Re: [rspec-users] Example controller spec no worky?

2008-02-13 Thread Jarkko Laine
On 13.2.2008, at 21.09, Brad Carson <[EMAIL PROTECTED]> wrote: > Pat Maddox wrote: >> Try >> >> Event.stub!(:find).and_raise(RecordNotFound) > > To my credit, I did try that (though ActiveRecord::RecordNotFound, of > course) but then I get: > > EventsController attempt to show non-existing event

Re: [rspec-users] Example controller spec no worky?

2008-02-13 Thread Brad Carson
Pat Maddox wrote: > Try > > Event.stub!(:find).and_raise(RecordNotFound) To my credit, I did try that (though ActiveRecord::RecordNotFound, of course) but then I get: EventsController attempt to show non-existing event - should render 404 (ERROR - 2) - should not assign an event (ERROR - 3) Ac

Re: [rspec-users] Example controller spec no worky?

2008-02-13 Thread Pat Maddox
Try Event.stub!(:find).and_raise(RecordNotFound) On 2/13/08, Brad Carson <[EMAIL PROTECTED]> wrote: > I'm trying to spec a dead simple "show non-existent record should render > 404" case, but it seems the RecordNotFound exception is making it > impossible for some reason. > > #controller > def sh

Re: [rspec-users] params are making my "should redirect_to" test fail - why??

2008-02-13 Thread David Chelimsky
On Feb 13, 2008 12:26 PM, Max Williams <[EMAIL PROTECTED]> wrote: > > I'm testing a controller action that redirects to a different action/view, > sending through some params. In my test, i'm only specifying the controller > and action that it should redirect to, but the additional params are maki

[rspec-users] Example controller spec no worky?

2008-02-13 Thread Brad Carson
I'm trying to spec a dead simple "show non-existent record should render 404" case, but it seems the RecordNotFound exception is making it impossible for some reason. #controller def show @event = Event.find(params[:id]) end #spec - pretty much straight from the rspec site before do Event

[rspec-users] params are making my "should redirect_to" test fail - why??

2008-02-13 Thread Max Williams
I'm testing a controller action that redirects to a different action/view, sending through some params. In my test, i'm only specifying the controller and action that it should redirect to, but the additional params are making it fail! Here's my test: it "should redirect to batch_saved after

Re: [rspec-users] need to learn by example

2008-02-13 Thread Colin Campbell-McPherson
I've just started a small rails project to test out BDD. It's a code golf application. Code golf is, for my money, the geekiest game out there. You set a challenge and users submit snippets of code. The winner is the person who submits the smallest piece of code that meets the requirements

[rspec-users] need to learn by example

2008-02-13 Thread Chuck Remes
I'm starting a new project which I would like to use as a learning opportunity for BDD. I've searched through the archives of this list for past pointers on web sites and books to peruse but I haven't found very many suggestions on good projects "in the wild" which put BDD on display. I'm

Re: [rspec-users] How do I mock out the before :login_required method?

2008-02-13 Thread Jarkko Laine
On 13.2.2008, at 5.12, Wes Shaddix wrote: I have a GroupController class that inherits from a SecuredController which have a before filter (before_filter :login_required). This is using the restul authentication system. I want to mock out the login_required method so that my GroupController act