import Ember from 'ember';
import Application from '../../app';
import config from '../../config/environment';

import './sign-in-user';
import './wait-for-element';

export default function startApp(attrs) {
  let application;

  // use defaults, but you can override;
  let attributes = Ember.assign({}, config.APP, attrs);

  Ember.run(() => {
    application = Application.create(attributes);
    application.setupForTesting();
    application.injectTestHelpers();
  });

  return application;
}

import Ember from 'ember';
import Application from '../../app';
import config from '../../config/environment';

import './sign-in-user';
import './wait-for-element';

export default function startApp(attrs) {
  let application;

  // use defaults, but you can override;
  let attributes = Ember.assign({}, config.APP, attrs);

  let clearStorage = (storage) => {
    storage.removeItem('travis.token');
    storage.removeItem('trvais.user');
  };

  clearStorage(localStorage);
  clearStorage(sessionStorage);

  Ember.run(() => {
    application = Application.create(attributes);
    application.setupForTesting();
    application.injectTestHelpers();
  });

  return application;
}

Clean auth data from storage before each acceptance test
Clean auth data from storage before each acceptance test

I run into problems of tests signing in a test user when they were not
supposed to, which usually made the test fail as all the data was not
available (permissions etc).

This commit fixes the problem by always cleaning up the storage data
before the app starts for an acceptance test.
