title: Testing Ember with Mocha - visit() causes tests to abort
body: <p>When running <code>visit()</code>, the Ember transition occurs correctly:
  <code>Transitioned into 'auth'</code>,</p>
  
  <p>however, PhantomJs does not load:
  <code>[D] ["phantomjs","onLoadFinished","fail"]</code></p>
  
  <p>How can this be fixed, why doesn't <code>visit()</code> work?</p>
  
  <hr>
  
  Details:
  
  <p>In a project generated using <code>yo ember</code>, I have the following test spec:</p>
  
  <pre><code>    var assert = chai.assert;
      var expect = chai.expect;
      var should = chai.should();
  
      App.rootElement = '#main';
      App.setupForTesting();
      App.injectTestHelpers();
  
      (function () {
          'use strict';
  
          beforeEach(function() {
              Ember.run(function() {
                  App.reset();
              });
              Ember.testing = true;
          });
  
          afterEach(function() {
              Ember.testing = false;
          });
  
          describe('Basic', function () {
  
              describe('Smoke test', function() {
                  visit('/auth');
  
                  it('Should contain a header', function() {
                      expect($('.main').length).to.equal(1);
                  });
              });
          });
      })();
  </code></pre>
  
  <p>when I run <code>grunt test --debug</code>, I get the following output:</p>
  
  <pre><code>    [D] ["phantomjs","console","generated -&gt; controller:application [object Object]"]
      generated -&gt; controller:application [object Object]
      [D] ["phantomjs","console","Rendering application with default view &lt;(subclass of Ember.View):ember650&gt; [object Object]"]
      Rendering application with default view &lt;(subclass of Ember.View):ember650&gt; [object Object]
      [D] ["phantomjs","console","Rendering auth with &lt;App.AuthView:ember664&gt; [object Object]"]
      Rendering auth with &lt;App.AuthView:ember664&gt; [object Object]
      [D] ["phantomjs","console","Transitioned into 'auth'"]
      Transitioned into 'auth'
      [D] ["phantomjs","onLoadFinished","fail"]
      [D] ["phantomjs","fail.load","http://localhost:9001/index.html"]
      ...ERROR
      Warning: PhantomJS unable to load "http://localhost:9001/index.html" URI. Use --force to continue.
  
      Aborted due to warnings.
  </code></pre>