-
-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails to pluralize factory
in unit test
#162
Comments
You need to customize your resolver to tell it about your pluralization rules. See ember-cli/ember-resolver#68 for details. |
The inflector that is present in ember-data would have properly handled this case (which is I'm sure why this was confusing), but we need to keep the resolver as light as possible (dependency wise) so we can't embed the inflector here. And since types in the system are generally static up front, it is "easy" enough to just define the translations for the resolver to use (and then it can fall back to "just add 's'"). |
Also, when you teach the resolver your pluralization rules you can delete that initializer (the resolver will lazily look up the factories as it needs to). |
Ok, that makes sense. Thanks for the quick reply and the explanation! |
I have a set of custom objects which I register in the namespace
factory
. All these objects are located in the folder/app/factories
. I register them in an initializer:When I unit test such a Factory object with:
It returns an error
TypeError: Attempting to register an unknown factory: 'factory:objectA'
. However, if I change it intothen the tests succeed.
So I think there's something wrong with how the pluralization works in the resolver.
The text was updated successfully, but these errors were encountered: