I'm trying to setup ember-testing with QUnit to test my Ember.js application following these blog post: Getting started with integration testing ember.js using ember-testing and qunit-rails
My problem is, that every time I try to visit a route with ember-testings visit helper, the visit(<route>).then
promise doesn't get called, but the correct view is rendered.
Here my current Ember.js setup: (I also tried with beta)
- Ember : 1.3.0-beta.1+canary.8f5b6e20
- Ember Data : 1.0.0-beta.4+canary.e7996c4d
- Handlebars : 1.1.1
- jQuery : 1.10.2
EDIT 1:
QUnit only shows, that the test is running, no failure or success message.
Test:
module("Ember.js Library", {
setup: function() {
Ember.run(App, App.advanceReadiness);
},
teardown: function() {
App.reset();
}
});
test("Check HTML is returned", function() {
expect(2);
visit("/").then(function() {
ok(false, "Show me an error!");
});
});
Test setup (test_helper.js):
document.write('<div id="ember-testing-container"><div id="ember-testing"></div></div>');
document.write('<style>#ember-testing-container { position: absolute; background: white; bottom: 0; right: 0; width: 640px; height: 384px; overflow: auto; z-index: 9999; border: 1px solid #ccc; } #ember-testing { zoom: 50%; }</style>');
App.rootElement = '#ember-testing';
App.setupForTesting();
App.injectTestHelpers();
EDIT 2:
QUnit seems to work correct. If I use the following Test, then QUnit test runner shows the correct failures. But if I include the assertion in the promise like above, then QUnit shows the test as running, but the test seems not to stop.
test("Check HTML is returned", function() {
expect(2);
ok(false, "Show me an error!");
});
/
, but I also have tried other routes like/login
. In case of login, the login view is rendered, but the test doesn't show success or failure message. – kunerd