Did your spec failed?<br>Would you paste it?<br><br><div class="gmail_quote">On Jan 14, 2008 9:32 PM, David Chelimsky <<a href="mailto:dchelimsky@gmail.com">dchelimsky@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 Jan 14, 2008 8:31 PM, 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>> 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></div>What's the failure message?<br><div class="Ih2E3d"><br>><br>> I appreciate it.<br>> -Corey<br>
><br>> --<br>> <a href="http://www.coreyhaines.com" target="_blank">http://www.coreyhaines.com</a><br>> The Internet's Premiere source of information about Corey Haines<br></div>> _______________________________________________
<br>> 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>><br>_______________________________________________<br>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></blockquote></div><br>