I&#39;m currently in a simliar situation as you.<br>I have an application that doesn&#39;t use the default routing.<br><br>When I try to write my stories.<br>ex.<br><br>And &quot;user logged in successfully&quot; do<br>&nbsp; post &quot;/session/create&quot;, :login =&gt; &quot;Jon&quot;, :password =&gt; &quot;your_momma&quot;
<br>&nbsp; response.should redirect_to(home_path)<br>end<br><br>The post fails unless I include this back into my routes file<br>&nbsp;&nbsp; map.connect &#39;:controller/:action/:id.:format&#39;<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
map.connect &#39;:controller/:action/:id&#39;</blockquote><div><br>and even then when I add them back in they&#39;ll conflict with my other routes and I have to comment out all my other routes.<br>But then it will pass.<br>
</div><br><div><span class="gmail_quote">On 9/22/07, <b class="gmail_sendername">Ben Mabey</b> &lt;<a href="mailto:ben@benmabey.com">ben@benmabey.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;">
Hi all,<br>The app I am making right now uses restful routing entirely.&nbsp;&nbsp;I want to<br>prevent people from accessing my actions without the proper HTTP verb so<br>I commented out the :controller/:action/:id catch all routes that were
<br>used in pre-RESTful Rails apps.&nbsp;&nbsp;Like so:<br>&nbsp;&nbsp; #map.connect &#39;:controller/:action/:id.:format&#39;<br>&nbsp;&nbsp; #map.connect &#39;:controller/:action/:id&#39;<br>When I did this however all of my routing specs broke.&nbsp;&nbsp;I have been
<br>testing my routes like the rspec-scaffold generator tests them:<br>it &quot;{ :controller =&gt; &#39;users&#39;, :action =&gt; &#39;new&#39; } to /users/new&quot; do<br>&nbsp;&nbsp;&nbsp;&nbsp;route_for(:controller =&gt; &quot;users&quot;, :action =&gt; &quot;new&quot;).should ==
<br>&quot;/users/new&quot;<br>end<br><br>To get around this the easiest thing I could think of was to add this to<br>my routes.rb:<br>if RAILS_ENV==&quot;test&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;map.connect &#39;:controller/:action/:id.:format&#39;
<br>&nbsp;&nbsp;&nbsp;&nbsp;map.connect &#39;:controller/:action/:id&#39;<br> end<br><br>Are there better solutions?<br>This is a workaround for the problem, but I&#39;m wondering if there is a<br>better way to test restful routes without relying on the old routing
<br>convention of controller/action/id.&nbsp;&nbsp;Ideally, the routing specs should<br>also verify the HTTP verb as well.&nbsp;&nbsp;Is there any way to do this?<br><br>Thanks,<br>Ben<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>