ah yes of course :)<br><br>So, now, &quot;should_not be_success&quot; passes ok, but should i be more specific and require a particular error code?&nbsp; If so, which would i get from a get call that&#39;s failed because of a RuntimeError exception?<br>
<br>thanks!<br><br><div><span class="gmail_quote">On 18/02/2008, <b class="gmail_sendername">Corey Haines</b> &lt;<a href="mailto:coreyhaines@gmail.com">coreyhaines@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Won&#39;t the exception get turned into a http return code from the get?<br><br><div class="gmail_quote"><div><span class="e" id="q_1182cbf663d01ab2_1">On Feb 18, 2008 8:29 AM, Max Williams &lt;<a href="mailto:toastkid.williams@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">toastkid.williams@gmail.com</a>&gt; wrote:<br>

</span></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><span class="e" id="q_1182cbf663d01ab2_3">I have a User controller where users aren&#39;t added with the usual new/create actions.&nbsp; I&#39;m trying to set it so that it raises when &#39;new&#39; is called but it doesn&#39;t seem to be working - here&#39;s the method, test and test result.&nbsp; Can anyone see why it&#39;s not working?<br>


<br>#in controller<br>&nbsp;def new<br>&nbsp;&nbsp;&nbsp; raise &quot;Users should be added with &#39;batch_add&#39; rather than &#39;new&quot;<br>&nbsp; end<br><br>#test<br>&nbsp; describe &quot;/new&quot; do<br>&nbsp;&nbsp;&nbsp; it &quot;should raise an error when called&quot; do<br>


&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lambda{get(&#39;new&#39;)}.should raise_error(RuntimeError)<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp; end<br><br>#test report<br>&#39;Admin::UserController /new should raise an error when called&#39; FAILED<br>expected RuntimeError but nothing was raised<br>


<br>
<br></span></div>_______________________________________________<br>rspec-users mailing list<br><a href="mailto:rspec-users@rubyforge.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rspec-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.coreyhaines.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.coreyhaines.com</a><br>The Internet&#39;s Premiere source of information about Corey Haines
<br>_______________________________________________<br>rspec-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>
</blockquote></div><br>