-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
resetModels when usingFixtureAdapter? #56
Comments
@blimmer , hmm .. I am thinking that this is not a great way to go, since the resetModels is usually called at the end of the test run in teardown .. or can also be called at the beginning. I see what you mean though about wanting to reset the Fixture arrays, but maybe you can call this in your test setup or override the setup method in the FactoryGuyTestMixin to accomplish the same thing? |
The part of I am not really relying on anything else that No big deal, this might not be useful for the ED FactoryGuy community as a whole just wanted to bring it up. |
Just curious @blimmer, have you tried NOT using FixtureAdapter in your tests, and using the REST or ActiveModel adapter instead ( assuming you are using one of those in your application )? Most people don't ever need to use FixtureAdapter when using FactoryGuy, since it handles the REST adapters just fine. |
@blimmer - Just curious, what are you calling to get
Are you invoking some sort of store.find on a model? Do you happen to have any small snippets of example tests you can share? Perhaps we can do something at the store level when using the fixture adapter to lazily add an empty fixture array if it's not already present. |
Going to close this, since the fixture adapter is no longer supported. |
👍 |
We override the
useFixtureAdapter
call inFactoryGuyTestMixin
because it conveniently sets all fixtures to an empty array. If we don't call it, we get these errors:Error: Error: Assertion Failed: Unable to find fixtures for model type App.ModelType)
We override the FactoryGuyTestMixin like this to fix the problem:
Is there any downside to having FactoryGuy do
resetModels
when callinguseFixtureAdapter
? I'm happy to do the PR if this behavior is acceptable.The text was updated successfully, but these errors were encountered: