Skip to content

Commit

Permalink
add test for postproccessTree(‘template’, …)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpenner committed Jun 9, 2015
1 parent a145538 commit 780df70
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/unit/broccoli/ember-app-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,31 @@ describe('broccoli/ember-app', function() {
expect(postprocessTreeStub.calledWith[0][0]).to.equal('css');
expect(postprocessTreeStub.calledWith[0][1].description).to.equal('styles', 'should be called with consolidated tree');
});


it('template type is called', function() {
var oldLoad = emberApp.registry.load;
emberApp.registry.load = function(type) {
if (type === 'template'){
return [
{
toTree: function() {
return {
description: 'template'
};
}
}];
} else {
return load.call(emberApp.registry, type);
}
};

emberApp._processedTemplatesTree();
expect(postprocessTreeStub.calledWith[0][0]).to.equal('template');
expect(postprocessTreeStub.calledWith[0][1].description).to.equal('template', 'should be called with consolidated tree');
});
});

describe('toTree', function() {
beforeEach(function() {
addon = {
Expand Down

0 comments on commit 780df70

Please sign in to comment.