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