searls/jasmine-rails — pull request #59 by mjm (2013-08-02 02:01:08+00:00)
Title: When window.onload is set by test code, phantomjs never exits.

I believe jQuery or some other library in my project was overwriting window.onload after the page was loading, so the logic to handle exiting phantom would never be called.

Changing this to use an event listener prevents it from being overridden.