Posted By

jlippiner on 10/23/12


Tagged

rspec Encoded capybara


Versions (?)

RSpec + Capybara method to visit a page and make sure no encoded HTML is displayed to use


 / Published in: Rails
 

RSpec + Capybara method to visit a page and make sure no encoded HTML is displayed to use. Stick in spec_helper

  1. # visits a page and makes sure there is no visible HTML to the user
  2. def screen(path)
  3. visit (path)
  4. if page.has_content?('</')
  5. save_and_open_page
  6. page.should_not have_content('</')
  7. end
  8. end

Report this snippet  

You need to login to post a comment.