class Capybara::RackTest::Browser

def follow(method, path, **attributes)

def follow(method, path, **attributes)
  return if path.gsub(/^#{Regexp.escape(request_path)}/, '').start_with?('#') || path.downcase.start_with?('javascript:')
  process_and_follow_redirects(method, path, attributes, 'HTTP_REFERER' => current_url)
end