On 1/14/08, Corey Haines <[EMAIL PROTECTED]> wrote: > Hi, all! > > I would love if someone could help me figure this out. I can't seem to see > why the following fails: > > Here's the spec: > it "should redirect back to the index page" do > Coupon.should_receive > (:new).with({"name"=>@expectedName,"amount"=>@expectedAmount}).and_return(@coupon) > @coupon.should_receive(:save) > response.should redirect_to(:action => 'index') > post > 'save_coupon',{:coupon=>{:name=>@expectedName,:amount=>@expectedAmount}}
I think you need to check the response after the post, not before. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users