Skip to content

Commit

Permalink
get locals after normalizing entity name
Browse files Browse the repository at this point in the history
  • Loading branch information
hlindset committed Aug 24, 2014
1 parent 84e031b commit 2dc4796
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -32,6 +32,7 @@
* [BUGFIX] Allow addons to use history support middleware [#1632](https://github.com/stefanpenner/ember-cli/pull/1632)
* [ENHANCEMENT] Upgrade `broccoli-ember-hbs-template-compiler` to `1.6.1`.
* [ENHANCEMENT] Allow file patterns to be ignored by LiveReload [#1706](https://github.com/stefanpenner/ember-cli/pull/1706)
* [BUGFIX] Call `normalizeEntityName` hook before `locals` hook [#1717](https://github.com/stefanpenner/ember-cli/pull/1717)

### 0.0.40

Expand Down
3 changes: 2 additions & 1 deletion lib/models/blueprint.js
Expand Up @@ -215,7 +215,6 @@ Blueprint.prototype.install = function(options) {
var ui = this.ui = options.ui;
var intoDir = options.target;
var dryRun = options.dryRun;
var locals = this._locals(options);
this.project = options.project;
this.testing = options.testing;

Expand Down Expand Up @@ -269,6 +268,8 @@ Blueprint.prototype.install = function(options) {
options.entity.name = this.normalizeEntityName(options.entity.name);
}

var locals = this._locals(options);

return Promise.resolve()
.then(this.beforeInstall.bind(this, options))
.then(this.processFiles.bind(this, intoDir, locals)).map(commit)
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/models/blueprint-test.js
Expand Up @@ -335,6 +335,16 @@ describe('Blueprint', function() {
assert.deepEqual(actualFiles, basicBlueprintFiles);
});
});

it('calls normalizeEntityName before locals hook is called', function(done) {
blueprint.normalizeEntityName = function(){ return 'foo'; };
blueprint.locals = function(options) {
assert.equal(options.entity.name, 'foo');
done();
};
options.entity = { name: 'bar' };
blueprint.install(options);
});
});

describe('addPackageToProject', function() {
Expand Down

0 comments on commit 2dc4796

Please sign in to comment.