Skip to content

Instantly share code, notes, and snippets.

@twalpole
Created October 27, 2016 02:04
Show Gist options
  • Save twalpole/9a79ca9d4fa0b090f0bcc8ca10f47bdc to your computer and use it in GitHub Desktop.
Save twalpole/9a79ca9d4fa0b090f0bcc8ca10f47bdc to your computer and use it in GitHub Desktop.
require "capybara/poltergeist"
html = DATA.read
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] }
sess = Capybara::Session.new(:poltergeist, app)
sess.visit("/")
# behavior to be tested here
__END__
<!doctype html>
<html>
<head>
<title>Some title</title>
</head>
<body>
<!-- HTML needed for the test -->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment