ES6: AvatarSelector and HeaderController - also includes support for controllers with

camelcase via an error message.
This commit is contained in:
Robin Ward
2014-04-29 21:16:57 -04:00
parent a4e30e8f93
commit eee5f85654
7 changed files with 40 additions and 12 deletions

View File

@ -14,6 +14,11 @@ function setTemplates(lookupStrings) {
});
}
function normalized(input, expected, desc) {
var resolver = Discourse.Resolver.create({namespace: Discourse});
equal(resolver.normalizeName(input), expected, desc);
}
module("Discourse.Resolver", {
setup: function() {
originalTemplates = Ember.TEMPLATES;
@ -29,6 +34,12 @@ module("Discourse.Resolver", {
}
});
test("normalizeName", function() {
normalized('header', 'header', 'a single word stays the same');
normalized('avatarSelector', 'avatar-selector', 'camel case is converted to dashed');
normalized('avatar_selector', 'avatar-selector', 'underscores are converted to dashes');
});
test("finds templates in top level dir", function() {
setTemplates([
"foobar",