great minds :)<br><br>thanks guys!<br><br><div><span class="gmail_quote">On 18/02/2008, <b class="gmail_sendername">David Chelimsky</b> &lt;<a href="mailto:dchelimsky@gmail.com">dchelimsky@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;">
On Feb 18, 2008 8:43 AM, Max Williams &lt;<a href="mailto:toastkid.williams@gmail.com">toastkid.williams@gmail.com</a>&gt; wrote:<br>&gt; ah yes of course :)<br>&gt;<br>&gt; So, now, &quot;should_not be_success&quot; passes ok, but should i be more specific<br>
&gt; and require a particular error code?&nbsp;&nbsp;If so, which would i get from a get<br>&gt; call that&#39;s failed because of a RuntimeError exception?<br><br>You should be able to discover that by specifying one (like 200) and<br>
seeing what you get.<br><br>response.error_code.should == 200<br><br>Cheers,<br>David<br><br>&gt;<br>&gt; thanks!<br>&gt;<br>&gt;<br>&gt;<br>&gt; On 18/02/2008, Corey Haines &lt;<a href="mailto:coreyhaines@gmail.com">coreyhaines@gmail.com</a>&gt; wrote:<br>
&gt; &gt; Won&#39;t the exception get turned into a http return code from the get?<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; On Feb 18, 2008 8:29 AM, Max Williams &lt;<a href="mailto:toastkid.williams@gmail.com">toastkid.williams@gmail.com</a>&gt; wrote:<br>
&gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; I have a User controller where users aren&#39;t added with the usual<br>&gt; new/create actions.&nbsp;&nbsp;I&#39;m trying to set it so that it raises when &#39;new&#39; is<br>&gt; called but it doesn&#39;t seem to be working - here&#39;s the method, test and test<br>
&gt; result.&nbsp;&nbsp;Can anyone see why it&#39;s not working?<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; #in controller<br>&gt; &gt; &gt;&nbsp;&nbsp;def new<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; raise &quot;Users should be added with &#39;batch_add&#39; rather than &#39;new&quot;<br>
&gt; &gt; &gt;&nbsp;&nbsp; end<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; #test<br>&gt; &gt; &gt;&nbsp;&nbsp; describe &quot;/new&quot; do<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; it &quot;should raise an error when called&quot; do<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lambda{get(&#39;new&#39;)}.should raise_error(RuntimeError)<br>
&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&gt; &gt; &gt;&nbsp;&nbsp; end<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; #test report<br>&gt; &gt; &gt; &#39;Admin::UserController /new should raise an error when called&#39; FAILED<br>&gt; &gt; &gt; expected RuntimeError but nothing was raised<br>
&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; _______________________________________________<br>&gt; &gt; &gt; rspec-users mailing list<br>&gt; &gt; &gt; <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>
&gt; &gt; &gt; <a href="http://rubyforge.org/mailman/listinfo/rspec-users">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>&gt; &gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; --<br>&gt; &gt; <a href="http://www.coreyhaines.com">http://www.coreyhaines.com</a><br>
&gt; &gt; The Internet&#39;s Premiere source of information about Corey Haines<br>&gt; &gt; _______________________________________________<br>&gt; &gt; rspec-users mailing list<br>&gt; &gt; <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>
&gt; &gt; <a href="http://rubyforge.org/mailman/listinfo/rspec-users">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>&gt; &gt;<br>&gt;<br>&gt;<br>&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">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">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>
</blockquote></div><br>