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


/ Published in: Rails
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.