That was it! Thanks, Rick!<br><br>Sorry about not posting the failure. DOH! Thanks again, everyone!<br><br>-Corey<br><br><div class="gmail_quote">On Jan 14, 2008 9:38 PM, Rick DeNatale <<a href="mailto:rick.denatale@gmail.com">
rick.denatale@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On 1/14/08, Corey Haines <<a href="mailto:coreyhaines@gmail.com">
coreyhaines@gmail.com</a>> wrote:<br>> Hi, all!<br>><br>> I would love if someone could help me figure this out. I can't seem to see<br>> why the following fails:<br>><br>> Here's the spec:<br>
> it "should redirect back to the index page" do<br>> Coupon.should_receive<br>> (:new).with({"name"=>@expectedName,"amount"=>@expectedAmount}).and_return(@coupon)<br>> @
coupon.should_receive(:save)<br>> response.should redirect_to(:action => 'index')<br>> post<br>> 'save_coupon',{:coupon=>{:name=>@expectedName,:amount=>@expectedAmount}}<br><br>
</div>I think you need to check the response after the post, not before.<br><font color="#888888"><br>--<br>Rick DeNatale<br><br>My blog on Ruby<br><a href="http://talklikeaduck.denhaven2.com/" target="_blank">http://talklikeaduck.denhaven2.com/
</a><br>_______________________________________________<br></font><div><div></div><div class="Wj3C7c">rspec-users mailing list<br><a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">
http://rubyforge.org/mailman/listinfo/rspec-users</a><br></div></div></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.coreyhaines.com">http://www.coreyhaines.com</a><br>The Internet's Premiere source of information about Corey Haines