Methods

Class Index [+]

Quicksearch

Merb::Test::Rspec::RouteMatchers

Public Instance Methods

route_to(klass_or_name, action) click to toggle source

Passes when the actual route parameters match the expected controller class and controller action. Exposes a with method for specifying parameters.

Parameters

klass_or_name<Class, String>

The controller class or class name to match routes for.

action<~to_s>

The name of the action to match routes for.

Example

  # Passes if a GET request to "/" is routed to the Widgets controller's
  # index action.
  request_to("/", :get).should route_to(Widgets, :index)

  # Use the 'with' method for parameter checks
  request_to("/123").should route_to(widgets, :show).with(:id => "123")
     # File lib/merb-core/test/matchers/route_matchers.rb, line 134
134:   def route_to(klass_or_name, action)
135:     RouteToMatcher.new(klass_or_name, action)
136:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.