Below is an example of how a routing RSpec test is written for a Rails 3 application
In spec/routing/behaviours_routing_spec.rb
describe Admin::BehavioursController do
describe “routing” do
it “routes to #index” do
get(“/behaviours”).should route_to(:controller => “admin/behaviours”,:action => “index”)
end
end
Hint: “rake routes” shows all the routes in the application
Leave a Reply