Did your spec failed?<br>Would you paste it?<br><br><div class="gmail_quote">On Jan 14, 2008 9:32 PM, David Chelimsky &lt;<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>&gt; 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 &lt;<a href="mailto:coreyhaines@gmail.com">coreyhaines@gmail.com</a>&gt; wrote:<br>&gt; Hi, all!<br>&gt;<br>&gt; I would love if someone could help me figure this out. I can&#39;t seem to see
<br>&gt; why the following fails:<br>&gt;<br>&gt; Here&#39;s the spec:<br>&gt; &nbsp; it &quot;should redirect back to the index page&quot; do<br>&gt; &nbsp; &nbsp; Coupon.should_receive<br>&gt; (:new).with({&quot;name&quot;=&gt;@expectedName,&quot;amount&quot;=&gt;@expectedAmount}).and_return(@coupon)
<br>&gt; &nbsp; &nbsp; @coupon.should_receive(:save)<br>&gt; &nbsp; &nbsp; response.should redirect_to(:action =&gt; &#39;index&#39;)<br>&gt; &nbsp; &nbsp; post<br>&gt; &#39;save_coupon&#39;,{:coupon=&gt;{:name=&gt;@expectedName,:amount=&gt;@expectedAmount}}
<br>&gt; &nbsp; end<br>&gt;<br>&gt; (the @vars are all set up)<br>&gt;<br>&gt; Here&#39;s the method:<br>&gt; &nbsp; def save_coupon<br>&gt; &nbsp; &nbsp; @coupon = Coupon.new(params[:coupon])<br>&gt; &nbsp; &nbsp; @coupon.save<br>&gt; &nbsp; &nbsp; redirect_to :action =&gt; :index
<br>&gt; &nbsp; end<br>&gt;<br>&gt; Now, I&#39;ve tried it through the browser, and it works. Any thoughts?<br><br></div>What&#39;s the failure message?<br><div class="Ih2E3d"><br>&gt;<br>&gt; I appreciate it.<br>&gt; -Corey<br>
&gt;<br>&gt; --<br>&gt; <a href="http://www.coreyhaines.com" target="_blank">http://www.coreyhaines.com</a><br>&gt; The Internet&#39;s Premiere source of information about Corey Haines<br></div>&gt; _______________________________________________
<br>&gt; rspec-users mailing list<br>&gt; <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>&gt; <a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users
</a><br>&gt;<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>