RSpec / RSpec Rails / Docs / Routing specs
This page comes from RSpec Rails 2.3.1. It is not part of the 6.0.1 docs. See the latest RSpec Rails docs.
access to named routes in routing specs
Scenario: access existing named route
- Given a file named "
spec/routing/widget_routes_spec.rb" with:rubyrequire "spec_helper" describe "routes to the widgets controller" do it "routes a named route" do {:get => new_widget_path}.should route_to(:controller => "widgets", :action => "new") end end - When I run "
rspec spec" - Then the output should contain "
1 example, 0 failures"
Source: features/routing_specs/access_to_named_routes.feature at v2.3.1, RSpec Rails (MIT license).