class RSpec::Rails::Matchers::RoutingMatchers::RouteToMatcher

def matches?(verb_to_path_map)

def matches?(verb_to_path_map)
  @actual = verb_to_path_map
  # assert_recognizes does not consider ActionController::RoutingError an
  # assertion failure, so we have to capture that and Assertion here.
  match_unless_raises ActiveSupport::TestCase::Assertion, ActionController::RoutingError do
    path, query = *verb_to_path_map.values.first.split('?')
    @scope.assert_recognizes(
      @expected,
      { method: verb_to_path_map.keys.first, path: path },
      Rack::Utils.parse_nested_query(query)
    )
  end
end