module Rails::Dom::Testing::Assertions::SelectorAssertions

def escape_id(selector)

def escape_id(selector)
  return unless selector
  id = selector.gsub('[', '\[')
  id.gsub!(']', '\]')
  id.gsub!('*', '\*')
  id.gsub!('(', '\(')
  id.gsub!(')', '\)')
  id.gsub!('.', '\.')
  id.gsub!('|', '\|')
  id.gsub!('^', '\^')
  id.gsub!('$', '\$')
  id.gsub!('+', "\\\\+")
  id.gsub!(',', '\,')
  id
end