Skip to content

Instantly share code, notes, and snippets.

@jferris
Created September 29, 2010 18:42
Show Gist options
  • Select an option

  • Save jferris/603295 to your computer and use it in GitHub Desktop.

Select an option

Save jferris/603295 to your computer and use it in GitHub Desktop.
Before do
Capybara.current_session.driver.rack_mock_session.after_request do
body = Capybara.current_session.driver.response.body
if match = body.match(%r{<\w+(?:\s+\w+\s*=\s*"[^&]+")*\s*/?>})
puts "WARNING: escaped tag: " +
match[0].gsub("&lt;", "<").gsub("&gt;", ">").gsub("&quot;", '"')
end
if match = body.match(%r{&amp;(\w+);})
puts "WARNING: escaped entity: &#{match[1]};"
end
end
end
@sdhull

sdhull commented May 11, 2012

Copy link
Copy Markdown

thanks @jferris I'll look into that next time I have some spare time! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment