class Spec::Rails::Matchers::RedirectTo

def matches?(response)

def matches?(response)
  @redirected = response.redirect?
  @actual = response.redirect_url
  return false unless @redirected
  if @expected.instance_of? Hash
    return false unless @actual =~ %r{^\w+://#{@request.host}}
    return false unless actual_redirect_to_valid_route
    return actual_hash == expected_hash
  else
    return @actual == expected_url
  end
end