travis-web/tests/helpers/start-app.js
Piotr Sarnacki 0e1fd2746f Add a simple acceptance test for dashboard and tooling needed to run it
Apart from adding a test, this commit also adds a dummy implementation
for Auth that can be used in tests to control the auth status.
2015-02-13 14:13:45 +01:00

26 lines
767 B
JavaScript

import Ember from 'ember';
import Application from '../../app';
import Router from '../../router';
import config from '../../config/environment';
export default function startApp(attrs) {
var application;
var attributes = Ember.merge({}, config.APP);
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
Ember.run(function() {
application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
});
// TODO: I'm not sure if this is the best thing to do, but it seems
// easiest for now. That way in tests I can just write:
//
// application.auth.signInForTests()
application.auth = application.__container__.lookup('auth:main');
return application;
}