class RSpec::Rails::Matchers::RoutingMatchers::BeRoutableMatcher
@private
Public Class Methods
new(scope)
click to toggle source
# File lib/rspec/rails/matchers/routing_matchers.rb, line 67 def initialize(scope) @scope = scope end
Public Instance Methods
description()
click to toggle source
# File lib/rspec/rails/matchers/routing_matchers.rb, line 88 def description "be routable" end
failure_message()
click to toggle source
# File lib/rspec/rails/matchers/routing_matchers.rb, line 80 def failure_message "expected #{@actual.inspect} to be routable" end
failure_message_when_negated()
click to toggle source
# File lib/rspec/rails/matchers/routing_matchers.rb, line 84 def failure_message_when_negated "expected #{@actual.inspect} not to be routable, but it routes to #{@routing_options.inspect}" end
matches?(path)
click to toggle source
# File lib/rspec/rails/matchers/routing_matchers.rb, line 71 def matches?(path) @actual = path match_unless_raises ActionController::RoutingError do @routing_options = @scope.routes.recognize_path( path.values.first, :method => path.keys.first ) end end