Hi all, The app I am making right now uses restful routing entirely. I want to prevent people from accessing my actions without the proper HTTP verb so I commented out the :controller/:action/:id catch all routes that were used in pre-RESTful Rails apps. Like so: #map.connect ':controller/:action/:id.:format' #map.connect ':controller/:action/:id' When I did this however all of my routing specs broke. I have been testing my routes like the rspec-scaffold generator tests them: it "{ :controller => 'users', :action => 'new' } to /users/new" do route_for(:controller => "users", :action => "new").should == "/users/new" end
To get around this the easiest thing I could think of was to add this to my routes.rb: if RAILS_ENV=="test" map.connect ':controller/:action/:id.:format' map.connect ':controller/:action/:id' end Are there better solutions? This is a workaround for the problem, but I'm wondering if there is a better way to test restful routes without relying on the old routing convention of controller/action/id. Ideally, the routing specs should also verify the HTTP verb as well. Is there any way to do this? Thanks, Ben _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users