Module Spec::Rails::Example::RoutingHelpers
In: lib/spec/rails/example/routing_helpers.rb

Methods

Classes and Modules

Class Spec::Rails::Example::RoutingHelpers::RouteFor

Public Instance methods

Uses ActionController::Routing::Routes to parse an incoming path so the parameters it generates can be checked

Note that this method is obsoleted by the route_to matcher.

Example

  params_from(:get, '/registrations/1/edit')
    => :controller => 'registrations', :action => 'edit', :id => '1'

Uses ActionController::Routing::Routes to generate the correct route for a given set of options.

Examples

  route_for(:controller => 'registrations', :action => 'edit', :id => '1')
    => '/registrations/1/edit'
  route_for(:controller => 'registrations', :action => 'create')
    => {:path => "/registrations", :method => :post}

[Validate]