You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a workaround that might suggest at the root cause. In my moduleForModel callbacks, I override the container's normalizeFullName method to dasherize strings:
The function I overrode is the default Ember implementation, which just returns fullName. This isn't necessary in in my actual app because the implementation looks like this:
function (fullName) {
if (resolver.normalize) {
return resolver.normalize(fullName);
} else {
Ember.deprecate('The Resolver should now provide a \'normalize\' function', false);
return fullName;
}
}
In my case I'm using the ActiveModelAdapter, which expects incoming json roots to be underscored. This is then converted to a camelCase name that is passed around in Ember Data, and then re-normalized to a dasherized name during resolution on the container. But in unit tests, it's never converted to the dasherized name and a lookup using the camelCase name fails.
The text was updated successfully, but these errors were encountered:
I ran into a problem writing unit tests that I detailed in a StackOverflow question:
http://stackoverflow.com/questions/28130262/how-do-i-use-a-multi-word-model-name-when-using-ember-cli
I found a workaround that might suggest at the root cause. In my moduleForModel callbacks, I override the container's normalizeFullName method to dasherize strings:
The function I overrode is the default Ember implementation, which just returns
fullName
. This isn't necessary in in my actual app because the implementation looks like this:In my case I'm using the ActiveModelAdapter, which expects incoming json roots to be underscored. This is then converted to a camelCase name that is passed around in Ember Data, and then re-normalized to a dasherized name during resolution on the container. But in unit tests, it's never converted to the dasherized name and a lookup using the camelCase name fails.
The text was updated successfully, but these errors were encountered: