title: Minimal Capybara / Poltergeist test returning empty page
body: <p>It appears I'm retracing the steps taken in the SO post:  <a href="https://stackoverflow.com/questions/15733827/capybara-poltergeist-and-phantomjs-and-giving-an-empty-response-in-body">Capybara, Poltergeist and Phantomjs and giving an empty response in body</a>.  (Mark this as a duplicate if you want, but I'm including a minimal standalone test case and version numbers.)</p>
  
  <h2>questions</h2>
  
  <p>Am I doing anything obviously wrong?  Is there another minimal test I can run that might help isolate the problem?</p>
  
  file: pgtest.rb
  
  <pre><code>require 'rubygems'
  require 'capybara'
  require 'capybara/dsl'
  require 'capybara/poltergeist'
  
  module PGTest
    include Capybara::DSL
    extend self
  
    def test
      Capybara.register_driver :poltergeist do |app|
        Capybara::Poltergeist::Driver.new(app)
      end
  
      Capybara.current_driver = :poltergeist
      session = Capybara::Session.new(:poltergeist)
  
      visit "http://www.google.com"
      sleep 5
      puts session.html
    end
  end
  
  PGTest.test
  </code></pre>
  
  <p>When invoked as follows, it prints an empty page:</p>
  
  <pre><code>$ ruby pgtest.rb
  &lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <h2>environment</h2>
  
  <ul>
  <li>OS X 10.8.5 (12F45)</li>
  <li>ruby 2.0.0p247 (2013-06-27) [x86_64-darwin12.4.0]</li>
  <li>phantomjs 1.9.2</li>
  <li>capybara (2.1.0)</li>
  <li>poltergeist (1.4.1)</li>
  </ul>
  
  <h2>absolving phantomjs</h2>
  
  <p>It's worth noting that I can use phantomjs extract the html from www.google.com:</p>
  
  file: pjs_dump.js
  
  <pre><code>var page = require('webpage').create();
  page.open("http://www.google.com", function () {
      var html = page.evaluate(function () {
          return document.documentElement.outerHTML;
      });
      console.log(html);
      phantom.exit();
  });
  </code></pre>
  
  <p>When I run 'phantomjs pjs_dump.js', it prints the html from www.google.com, so phantomjs appears to be working properly.</p>