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
Always execute a reload when Rails triggers one (instead of just on u… #329
Conversation
@composerinteralia there are 3 failing specs where |
Maybe because the |
that is indeed what is happening. given this comment rails/rails#28111 (comment) should the specs assert that |
Yeah, that makes sense to me |
…pdate) to prevent doubly-defined constants errors in factories when using Spring - #323
@composerinteralia if you feel like adding that spec to prove Spring and |
Thanks! I'll try to find some time on Friday to look at this. |
This test captures what I think is going on in #323 Currently the factory_bot_rails reloader only reloads factory definitions when the definition files have changes (using `execute_if_updated`). This can cause problems when editing an application file without also editing a factory_bot definition file. Rails will reload the entire application, but will not reload the definitions. This causes factory_bot to have references to classes that were unloaded from the Rails application and replaced with new classes. #329 replaces `execute_if_updated` with `execute` so that factory_bot_rails will reload the definition files whenever anything in the application is changed. Hopefully that PR will get this test to pass!
@jakeonfire I added a failing test in #330 Can you give that a review when you have a chance? It looks like it does indeed pass with your PR. 🎉 |
This test captures what I think is going on in #323 Currently the factory_bot_rails reloader only reloads factory definitions when the definition files have changes (using `execute_if_updated`). This can cause problems when editing an application file without also editing a factory_bot definition file. Rails will reload the entire application, but will not reload the definitions. This causes factory_bot to have references to classes that were unloaded from the Rails application and replaced with new classes. #329 replaces `execute_if_updated` with `execute` so that factory_bot_rails will reload the definition files whenever anything in the application is changed. Hopefully that PR will get this test to pass!
This test captures what I think is going on in #323 Currently the factory_bot_rails reloader only reloads factory definitions when the definition files have changes (using `execute_if_updated`). This can cause problems when editing an application file without also editing a factory_bot definition file. Rails will reload the entire application, but will not reload the definitions. This causes factory_bot to have references to classes that were unloaded from the Rails application and replaced with new classes. #329 replaces `execute_if_updated` with `execute` so that factory_bot_rails will reload the definition files whenever anything in the application is changed. Hopefully that PR will get this test to pass!
* Write a failing test for reloading with Spring This test captures what I think is going on in #323 Currently the factory_bot_rails reloader only reloads factory definitions when the definition files have changes (using `execute_if_updated`). This can cause problems when editing an application file without also editing a factory_bot definition file. Rails will reload the entire application, but will not reload the definitions. This causes factory_bot to have references to classes that were unloaded from the Rails application and replaced with new classes. #329 replaces `execute_if_updated` with `execute` so that factory_bot_rails will reload the definition files whenever anything in the application is changed. Hopefully that PR will get this test to pass!
Thanks again! |
…pdate) to prevent doubly-defined constants errors in factories when using Spring