Module: RSpec::Rails::Matchers::RoutingMatchers

### Home Classes Methods

### In Files

- lib/rspec/rails/matchers/routing_matchers.rb

### Namespace

- MODULE RSpec::Rails::Matchers::RoutingMatchers::RouteHelpers
- CLASS RSpec::Rails::Matchers::RoutingMatchers::BeRoutableMatcher
- CLASS RSpec::Rails::Matchers::RoutingMatchers::RouteToMatcher

### Methods

- #be_routable
- #route_to

### Files

- fixture

### Class/Module Index

Quicksearch

- RSpec
- RSpec::Rails
- RSpec::Rails::AssertionDelegator
- RSpec::Rails::ControllerExampleGroup
- RSpec::Rails::ControllerExampleGroup::BypassRescue
- RSpec::Rails::ControllerExampleGroup::ClassMethods
- RSpec::Rails::Extensions
- RSpec::Rails::Extensions::ActiveRecord
- RSpec::Rails::FeatureExampleGroup
- RSpec::Rails::FixtureSupport
- RSpec::Rails::HelperExampleGroup
- RSpec::Rails::HelperExampleGroup::ClassMethods
- RSpec::Rails::IllegalDataAccessException
- RSpec::Rails::MailerExampleGroup
- RSpec::Rails::MailerExampleGroup::ClassMethods
- RSpec::Rails::Matchers
- RSpec::Rails::Matchers::BeANew
- RSpec::Rails::Matchers::BeANewRecord
- RSpec::Rails::Matchers::BeValid
- RSpec::Rails::Matchers::HaveExtensions
- RSpec::Rails::Matchers::RedirectTo
- RSpec::Rails::Matchers::RedirectTo::RedirectTo
- RSpec::Rails::Matchers::RenderTemplate
- RSpec::Rails::Matchers::RenderTemplate::RenderTemplateMatcher
- RSpec::Rails::Matchers::RoutingMatchers
- RSpec::Rails::Matchers::RoutingMatchers::BeRoutableMatcher
- RSpec::Rails::Matchers::RoutingMatchers::RouteHelpers
- RSpec::Rails::Matchers::RoutingMatchers::RouteToMatcher
- RSpec::Rails::MiniTestLifecycleAdapter
- RSpec::Rails::MinitestCounters
- RSpec::Rails::Mocks
- RSpec::Rails::Mocks::ActiveModelInstanceMethods
- RSpec::Rails::Mocks::ActiveModelStubExtensions
- RSpec::Rails::Mocks::ActiveRecordInstanceMethods
- RSpec::Rails::Mocks::ActiveRecordStubExtensions
- RSpec::Rails::ModelExampleGroup
- RSpec::Rails::ModuleInclusion
- RSpec::Rails::RailsExampleGroup
- RSpec::Rails::Railtie
- RSpec::Rails::RequestExampleGroup
- RSpec::Rails::RoutingExampleGroup
- RSpec::Rails::RoutingExampleGroup::ClassMethods
- RSpec::Rails::SetupAndTeardownAdapter
- RSpec::Rails::SetupAndTeardownAdapter::ClassMethods
- RSpec::Rails::TestUnitAssertionAdapter
- RSpec::Rails::TestUnitAssertionAdapter::AssertionDelegator
- RSpec::Rails::TestUnitAssertionAdapter::ClassMethods
- RSpec::Rails::Version
- RSpec::Rails::ViewAssigns
- RSpec::Rails::ViewExampleGroup
- RSpec::Rails::ViewExampleGroup::ClassMethods
- RSpec::Rails::ViewExampleGroup::ExampleMethods
- RSpec::Rails::ViewRendering
- RSpec::Rails::ViewRendering::ClassMethods
- RSpec::Rails::ViewRendering::EmptyTemplateHandler
- RSpec::Rails::ViewRendering::EmptyTemplatePathSetDecorator
- RSpec::Rails::ViewRendering::EmptyTemplates
- Rspec
- Rspec::Generators
- Rspec::Generators::Base
- Rspec::Generators::ControllerGenerator
- Rspec::Generators::HelperGenerator
- Rspec::Generators::InstallGenerator
- Rspec::Generators::IntegrationGenerator
- Rspec::Generators::MailerGenerator
- Rspec::Generators::ModelGenerator
- Rspec::Generators::ObserverGenerator
- Rspec::Generators::ScaffoldGenerator
- Rspec::Generators::ViewGenerator
- Rails
- Rails::Generators
- Rails::Generators::GeneratedAttribute
- Test
- Test::Unit
- Test::Unit::AssertionFailedError
- ActiveModel
- ActiveModel::Validations
- ActiveRecord
- ActiveRecord::Base
- Autotest
- Autotest::RailsRspec2
- Object
- RequestInstanceMethods

No matching classes.

# RSpec::Rails::Matchers::RoutingMatchers

### Public Instance Methods

be_routable() click to toggle source

Passes if the route expression is recognized by the Rails router based on the declarations in `config/routes.rb`. Delegates to `RouteSet#recognize_path`.

@example

You can use route helpers provided by rspec-rails.

    {:get =>  "/a/path"}.should be_routable
    {:post => "/another/path"}.should be_routable
    {:put => "/yet/another/path"}.should_not be_routable

    # File lib/rspec/rails/matchers/routing_matchers.rb, line 95
    def be_routable
      BeRoutableMatcher.new(self)
    end

route_to(*expected) click to toggle source

Delegates to `assert_recognizes`. Supports short-hand controller/action declarations (e.g. `"controlleraction"`).

@example

    { :get => "/things/special" }.should route_to(
      :controller => "things",
      :action     => "special"
    )

    { :get => "/things/special" }.should route_to("things#special")

@see api.rubyonrails.org/classes/ActionDispatch/Assertions/RoutingAssertions.html#method-i-assert_recognizes

    # File lib/rspec/rails/matchers/routing_matchers.rb, line 56
    def route_to(*expected)
      RouteToMatcher.new(self, *expected)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.