You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
853 B
31 lines
853 B
// in order to see the app running inside the QUnit runner |
|
App.rootElement = '#ember-testing'; |
|
|
|
// Common test setup |
|
App.setupForTesting(); |
|
App.injectTestHelpers(); |
|
|
|
// common QUnit module declaration |
|
module("Integration tests", { |
|
setup: function() { |
|
// before each test, ensure the application is ready to run. |
|
Ember.run(App, App.advanceReadiness); |
|
}, |
|
|
|
teardown: function() { |
|
// reset the application state between each test |
|
App.reset(); |
|
} |
|
}); |
|
|
|
// QUnit test case |
|
test("/", function() { |
|
// async helper telling the application to go to the '/' route |
|
visit("/"); |
|
|
|
// helper waiting the application is idle before running the callback |
|
andThen(function() { |
|
equal(find("h2").text(), "Welcome to Ember.js", "Application header is rendered"); |
|
equal(find("li").length, 3, "There are three items in the list"); |
|
}); |
|
}); |