Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using both
minitest-spec-rails
andview_component
in the same project, tests would blow up with the following stack trace:After some investigation I traced the problem to the way
MiniTestSpecRails::Init::ActionViewBehavior
is included on line 22 oflib/minitest-spec-rails/init/action_view.rb
. Rails 7 drops support for the classic autoloader and now only supports zeitwerk. Wrapping the include statement in a to prepare block, solves the issue:For more details, see: https://edgeguides.rubyonrails.org/autoloading_and_reloading_constants.html#use-case-1-during-boot-load-reloadable-code
The same pattern for including code is used in all the other parts of the railtie and should probably be patched as well, but I have not experienced any other issues with this gem and Rails 7
This issue seems similar to #109 and I suspect, that this might solve that issue as well.