Skip to content

Commit

Permalink
destroy the subject in teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeOfficer committed Feb 21, 2015
1 parent 8e6ead2 commit 1aef8eb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/ember-test-helpers/test-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default Klass.extend({
delete this.callbacks.teardown;
}

this.teardownSteps.push(this.teardownSubject);
this.teardownSteps.push(this.teardownContainer);
this.teardownSteps.push(this.teardownContext);
this.teardownSteps.push(this.teardownTestElements);
Expand Down Expand Up @@ -122,6 +123,14 @@ export default Klass.extend({
}
},

teardownSubject: function() {
var subject = this.cache.subject;

if (subject) {
Ember.run(subject, 'destroy');
}
},

teardownContainer: function() {
var container = this.container;
Ember.run(function() {
Expand Down

0 comments on commit 1aef8eb

Please sign in to comment.