Class: RSpec::Rails::Matchers::RoutingMatchers::BeRoutableMatcher
- Inherits:
-
Object
- Object
- RSpec::Rails::Matchers::RoutingMatchers::BeRoutableMatcher
- Includes:
- Matchers::BaseMatcher
- Defined in:
- lib/rspec/rails/matchers/routing_matchers.rb
Instance Method Summary collapse
- #failure_message_for_should_not ⇒ Object private
-
#initialize(scope) ⇒ BeRoutableMatcher
constructor
A new instance of BeRoutableMatcher.
- #matches?(path) ⇒ Boolean private
Constructor Details
#initialize(scope) ⇒ BeRoutableMatcher
Returns a new instance of BeRoutableMatcher.
57 58 59 |
# File 'lib/rspec/rails/matchers/routing_matchers.rb', line 57 def initialize(scope) @scope = scope end |
Instance Method Details
#failure_message_for_should_not ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
72 73 74 |
# File 'lib/rspec/rails/matchers/routing_matchers.rb', line 72 def "expected #{actual.inspect} not to be routable, but it routes to #{@routing_options.inspect}" end |
#matches?(path) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
62 63 64 65 66 67 68 69 |
# File 'lib/rspec/rails/matchers/routing_matchers.rb', line 62 def matches?(path) super(path) match_unless_raises ActionController::RoutingError do @routing_options = @scope.routes.recognize_path( path.values.first, :method => path.keys.first ) end end |