title: Headless testing Ember application with guard and jasmine
body: <p>I'm trying to use jasmine and guard to test an ember based frontend for my rails 3.2 application. For this, I use jasminerice and guard-jasmine, phantomjs. The setup was very easy and simple and I can run some sample specs. When it comes to play with ember, things go mad. I have the spec below that test a video reader class. It should set videoHeight and  videoWitdh property with the value of the corresponding video DOM element when calling loadVideo method.
  When I run jasmine on my browser the test pass, but when I run it with guard and phantomjs, it fails. I got "Expect undefined to equal 640". It seems that my DOM element is not taking into account when the test run on phantomjs. </p>
  
  <pre><code>describe "VideoReader", -&gt;
    it "loads video from video DOM element", -&gt;
      videoDOM = Ember.$("&lt;video width='640' height='480'&gt;&lt;source src='/test.mp4'&gt;&lt;/source&gt;&lt;/video&gt;")[0];
  
      player = Topper.VideoReader.create();
  
      player.loadVideo(videoDOM);
  
      videoHeight = player.get('videoHeight');
      videoWidth  = player.get('videoWidth');
  
      expect(videoHeight).toEqual(480);
      expect(videoWidth).toEqual(640);
  </code></pre>
  
  <p>Is my spec correctly written ?</p>