Rails + Teaspoon + QUnit + Ember = Broken?


#1

Hi Folks,

I’m trying to get a basic integration test up and running, using Rails 4.0.1, Teaspoon 0.8.0 and QUnit 1.14.10 and something weird is happening.

This is the test:

module('Routing specs', {
  setup: function() {
    App.reset();
  }
});

test('Printers', function(){
  expect(1);
  visit('/');
  andThen(function(){
    console.log('Here I am');
    ok(false, 'hit!');
  });
});

It seems that the andThen is never resolved and entered. The Ember app initializes, and loads fine, However there are no console message, no assertion. The output from Teaspoon on the web page is:

Expected 1 assertions, but 0 were run

What’s going on? This used to work. Here’s the spec_helper.js

//= require jquery
//= require ember_application
//= require_self

var d=document;
d.write('<div id="ember-testing-container"><div id="ember-testing"></div></div>');

App.rootElement = '#ember-testing';
App.setupForTesting();
App.injectTestHelpers();

#2

In case anyone is following after me, the root cause is using Ember.run.later, which causes the visit() call to never finalize. See here: http://stackoverflow.com/questions/27851517/ember-integration-testing-hangs-after-visiting-route