perfect - that's the method i was looking for. Thanks! <br><br><div><span class="gmail_quote">On 14/02/2008, <b class="gmail_sendername">Rick DeNatale</b> <<a href="mailto:rick.denatale@gmail.com">rick.denatale@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 2/14/08, Max Williams <<a href="mailto:toastkid.williams@gmail.com">toastkid.williams@gmail.com</a>> wrote:<br> > Hi David - thanks for replying. The literal doesn't work either, because of<br> > all the params at the end, and i don't have named routes in this old,<br>
> non-restful app. I see your point about the hash...is there any way to get<br> > the redirected-to url from 'response' and test against that? Then i could<br> > split it at "?" to ignore the params. (I'd rather not include the specific<br>
> params in this test since i really just want to know about where it's<br> > redirected to).<br> ><br> > So, ideally i could do something like this -<br> ><br> > response.url.split("?").first.should<br>
> eql("<a href="http://test.host/admin/users/batch_saved">http://test.host/admin/users/batch_saved</a>")<br> ><br> > I've been looking for documentation for methods for the response object, to<br>
> get the url, but i can't find any in the api docs (i'm probably just looking<br> > in the wrong place). I can see the url data in the object but it's private.<br> <br> <br>Well the RedirectTo matcher gets it using<br>
<br> response.redirect_url<br> <br> I'd probably write the check as<br> <br> response.should be_redirect<br> response.redirect_url.should<br> match(%r{^<a href="http://test.host/admin/users/batch_saved(\?|$)}">http://test.host/admin/users/batch_saved(\?|$)}</a>)<br>
<br><br> --<br> Rick DeNatale<br> <br> My blog on Ruby<br> <a href="http://talklikeaduck.denhaven2.com/">http://talklikeaduck.denhaven2.com/</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>