Hi, all!<br><br>I would love if someone could help me figure this out. I can't seem to see why the following fails:<br><br>Here's the spec:<br> it "should redirect back to the index page" do<br> Coupon.should_receive
(:new).with({"name"=>@expectedName,"amount"=>@expectedAmount}).and_return(@coupon)<br> @coupon.should_receive(:save)<br> response.should redirect_to(:action => 'index')<br> post 'save_coupon',{:coupon=>{:name=>@expectedName,:amount=>@expectedAmount}}
<br> end<br><br>(the @vars are all set up)<br><br>Here's the method:<br> def save_coupon<br> @coupon = Coupon.new(params[:coupon])<br> @coupon.save<br> redirect_to :action => :index<br> end<br><br>Now, I've tried it through the browser, and it works. Any thoughts?
<br><br>I appreciate it.<br>-Corey<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