Re: [rspec-users] New rescue_from handling in rspec-rails 1.1.12

2009-01-15 Thread Chris Kampmeier
On Wed, Jan 14, 2009 at 7:30 PM, David Chelimsky wrote: > On Wed, Jan 14, 2009 at 8:23 PM, Chris Kampmeier > wrote: > > > (Or, here's a syntax-highlighted pastie: http://pastie.org/361114) > > Don't forget that the spec should come first :) Also, you're spec

[rspec-users] New rescue_from handling in rspec-rails 1.1.12

2009-01-14 Thread Chris Kampmeier
he behavior I'm expecting: response.should redirect_to("/"). Or, I could alias_method_chain ActionController::Rescue#rescue_action and hack the old behavior back in. I don't really want to do that, though--somebody who was familiar with RSpec but hadn't seen our code b

Re: [rspec-users] Mocking and stubbing Rails' association extensions

2008-01-10 Thread Chris Kampmeier
On 1/10/08, Rick DeNatale <[EMAIL PROTECTED]> wrote: > > So why not > > songs = [song1, song2, song3] > album.stub!(:songs).and_return(songs) > songs.stub!(:streamable).and_return([song1, song2]) Oh, of course. Thank you. I think my mind was in a rut of "must use mock or mock_model" and I didn't

Re: [rspec-users] Mocking and stubbing Rails' association extensions

2008-01-10 Thread Chris Kampmeier
On 1/10/08, David Chelimsky <[EMAIL PROTECTED]> wrote: > album = mock("album") > songs = mock("songs") > album.stub!(:songs).and_return(songs) > songs.stub!(:streamable).and_return(true) > > That's the general idea. Specifics will vary for each example. If I do this, I end up with a mock object

[rspec-users] Mocking and stubbing Rails' association extensions

2008-01-10 Thread Chris Kampmeier
) Before adding the extension, I just had @album.songs returning an array of Song instances. The only thing I've thought of that would work is temporarily extending Array itself to respond to #streamable, but that feels ugly. Thanks for any ideas, Chris Kampmeier http://www.shiftco