Skip to content
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

Write a failing test for reloading with Spring #330

Merged
merged 2 commits into from Apr 5, 2019

Conversation

composerinteralia
Copy link
Collaborator

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!
@iwz
Copy link

iwz commented Apr 5, 2019

Chatted IRL: the build was failing for the wrong reasons on previous versions of rails (bin/rails test was not available). Daniel switched it to rake test

@composerinteralia
Copy link
Collaborator Author

Oh no! Now all the tests are passing. That was not supposed to happen.

@mike-burns
Copy link
Member

Seems right, and the CI failures all seem correct. It seems to pass on Rails 6 -- so this is fixed there, too?

@composerinteralia
Copy link
Collaborator Author

I was actually surprised to see the Rails 6 tests passing, but I assume it is because of the new Zietwerk loader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants