Skip to content

Commit

Permalink
Store acceptance test application in test context.
Browse files Browse the repository at this point in the history
This allows custom test assertions to access the application without
manually passing in the application.
  • Loading branch information
rwjblue committed Jul 17, 2015
1 parent 3db4a0a commit 1f3c8fe
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '<%= testFolderRoot %>/tests/helpers/start-app';

var application;

module('<%= friendlyTestName %>', {
beforeEach: function() {
application = startApp();
this.application = startApp();
},

afterEach: function() {
Ember.run(application, 'destroy');
Ember.run(this.application, 'destroy');
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import Ember from 'ember';
import startApp from '../helpers/start-app';
import { module, test } from 'qunit';

var application;

module('Acceptance', {
beforeEach: function() {
application = startApp();
this.application = startApp();
},
afterEach: function() {
Ember.run(application, 'destroy');
Ember.run(this.application, 'destroy');
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ import Ember from 'ember';
import startApp from '../helpers/start-app';
import { module, test } from 'qunit';

var application;

module('default-development - Integration', {
beforeEach: function() {
application = startApp();
this.application = startApp();
},
afterEach: function() {
Ember.run(application, 'destroy');
Ember.run(this.application, 'destroy');
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ import Ember from 'ember';
import startApp from '../helpers/start-app';
import { module, test } from 'qunit';

var application;

module('pods based templates', {
beforeEach: function() {
application = startApp();
this.application = startApp();
},
afterEach: function() {
Ember.run(application, 'destroy');
Ember.run(this.application, 'destroy');
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ import Ember from 'ember';
import startApp from '../helpers/start-app';
import { module, test } from 'qunit';

var application;

module('pods based templates', {
beforeEach: function() {
application = startApp();
this.application = startApp();
},
afterEach: function() {
Ember.run(application, 'destroy');
Ember.run(this.application, 'destroy');
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ import Ember from 'ember';
import startApp from '../helpers/start-app';
import { module, test } from 'qunit';

var application;

module('wrapInEval in-app test', {
beforeEach: function() {
application = startApp();
this.application = startApp();
},
afterEach: function() {
Ember.run(application, 'destroy');
Ember.run(this.application, 'destroy');
}
});

Expand Down
6 changes: 2 additions & 4 deletions tests/fixtures/generate/acceptance-test-expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from 'my-app/tests/helpers/start-app';

var application;

module('Acceptance | foo', {
beforeEach: function() {
application = startApp();
this.application = startApp();
},

afterEach: function() {
Ember.run(application, 'destroy');
Ember.run(this.application, 'destroy');
}
});

Expand Down
6 changes: 2 additions & 4 deletions tests/fixtures/generate/addon-acceptance-test-expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '../../tests/helpers/start-app';

var application;

module('Acceptance | foo', {
beforeEach: function() {
application = startApp();
this.application = startApp();
},

afterEach: function() {
Ember.run(application, 'destroy');
Ember.run(this.application, 'destroy');
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from '../../../tests/helpers/start-app';

var application;

module('Acceptance | foo/bar', {
beforeEach: function() {
application = startApp();
this.application = startApp();
},

afterEach: function() {
Ember.run(application, 'destroy');
Ember.run(this.application, 'destroy');
}
});

Expand Down

0 comments on commit 1f3c8fe

Please sign in to comment.