Hi David - thanks for replying.&nbsp; The literal doesn&#39;t work either, because of all the params at the end, and i don&#39;t have named routes in this old, non-restful app.&nbsp; I see your point about the hash...is there any way to get the redirected-to url from &#39;response&#39; and test against that?&nbsp; Then i could split it at &quot;?&quot; to ignore the params.&nbsp; (I&#39;d rather not include the specific params in this test since i really just want to know about where it&#39;s redirected to).<br>
<br>So, ideally i could do something like this - <br><br>response.url.split(&quot;?&quot;).first.should eql(&quot;<a href="http://test.host/admin/users/batch_saved">http://test.host/admin/users/batch_saved</a>&quot;)<br><br>
I&#39;ve been looking for documentation for methods for the response object, to get the url, but i can&#39;t find any in the api docs (i&#39;m probably just looking in the wrong place).&nbsp; I can see the url data in the object but it&#39;s private.<br>
<br>thanks<br>max<br><br><div><span class="gmail_quote">On 13/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 13, 2008 12:26 PM, Max Williams &lt;<a href="mailto:toastkid.williams@gmail.com">toastkid.williams@gmail.com</a>&gt; wrote:<br> &gt;<br> &gt; I&#39;m testing a controller action that redirects to a different action/view,<br>
 &gt; sending through some params.&nbsp;&nbsp;In my test, i&#39;m only specifying the controller<br> &gt; and action that it should redirect to, but the additional params are making<br> &gt; it fail!&nbsp;&nbsp;Here&#39;s my test:<br> &gt;<br>
 &gt;&nbsp;&nbsp; it &quot;should redirect to batch_saved after completing batch_save&quot; do<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp; post &#39;batch_save&#39;, @params<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp; response.should redirect_to(:controller =&gt; &#39;admin/users&#39;, :action =&gt;<br>
 &gt; &#39;batch_saved&#39;)<br> &gt;&nbsp;&nbsp; end<br> &gt;<br> &gt; and here&#39;s the failure report:<br> &gt;<br> &gt; &#39;Admin::UserController When logged in as an admin level user should redirect<br> &gt; to batch_saved after batch_save&#39; FAILED<br>
 &gt; expected redirect to {:controller=&gt;&quot;admin/users&quot;, :action=&gt;&quot;batch_saved&quot;},<br> &gt; got redirect to<br> &gt; &quot;<a href="http://test.host/admin/users/batch_saved?music_service_id=1&amp;new_users%5B%5D%5Bemail%5D=mark%40zadeup.com&amp;new_users%5B%5D%5Bfirstname%5D=Mark&amp;new_users%5B%5D%5Bmusic_service_id%5D=1&amp;new_users%5B%5D%5Bschool%5D=&amp;new_users%5B%5D%5Bsurname%5D=Madeup">http://test.host/admin/users/batch_saved?music_service_id=1&amp;new_users%5B%5D%5Bemail%5D=mark%40zadeup.com&amp;new_users%5B%5D%5Bfirstname%5D=Mark&amp;new_users%5B%5D%5Bmusic_service_id%5D=1&amp;new_users%5B%5D%5Bschool%5D=&amp;new_users%5B%5D%5Bsurname%5D=Madeup</a>&quot;<br>
 &gt;<br> &gt; Now, i would expect that since i&#39;m just specifying a controller and action,<br> &gt; and we redirect to them, that the test would pass.&nbsp;&nbsp;But the params are<br> &gt; breaking it (I know this because i changed the controller action to not send<br>
 &gt; params through at all and the test passed).&nbsp;&nbsp;How do i do the test so that it<br> &gt; doesn&#39;t care about the params?<br> <br> <br>When you use a hash it checks the whole hash, so this is the expected behaviour.<br>
 <br> You can either used a named route (if you&#39;ve got one available) or a<br> String literal:<br> <br> response.should redirect_to(admin_users_batch_saved)<br> response.should redirect_to(&#39;/admin/users/batch_saved&#39;)<br>
 <br> Based on Jay Field&#39;s latest advice<br> (<a href="http://blog.jayfields.com/2008/02/testing-expect-literals.html">http://blog.jayfields.com/2008/02/testing-expect-literals.html</a>) you<br> may want to consider the literal.<br>
 <br> HTH,<br> David<br> <br> <br> &gt;<br> &gt;<br> &gt; --<br> <br>&gt; View this message in context: <a href="http://www.nabble.com/params-are-making-my-%22should-redirect_to%22-test-fail---why---tp15460582p15460582.html">http://www.nabble.com/params-are-making-my-%22should-redirect_to%22-test-fail---why---tp15460582p15460582.html</a><br>
 &gt; Sent from the rspec-users mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<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>