Closed bravehager closed 4 months ago
Thanks! Wondering if we need a test for this... it seems fairly low risk. @egiurleo?
The UrlHelpersSpec
tests don't even seem to fail when running them with Rails main (RAILS_VERSION=main bundle install && bin/test spec/tapioca/dsl/compilers/url_helpers_spec.rb
). I've been trying to write a integration test for this but I think it would require pretty significant changes to the DSL integration spec, which doesn't seem worth it.
I'm testing against Shopify core to make sure this doesn't break anything.
Motivation
The URL helpers DSL compiler appears broken after https://github.com/rails/rails/commit/e97db3b3957781c781a61fb01265feb2b57688bb introduced deferred route drawing.
This leads to all helper methods being stripped from
GeneratedUrlHelpersModule
andGeneratedPathHelpersModule
.Implementation
Ensure routes are loaded before generating
GeneratedUrlHelpersModule
andGeneratedPathHelpersModule
.Tests
I was able to manually test this out in one of our Rails applications at @justworkshr.
Open to any ideas on how to unit test this behavior—it seems like the existing tests pass despite the change in Rails itself.