Remove the route that is defined by default
Some test code loads the route file twice. This wasn't a problem before Rails 7.0 because we didn't have a route.
But, Rails 7.1 has one route by default. So the test application raises the following error during the load.
Invalid route name, already in use: 'rails_health_check' (ArgumentError)
You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already
defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained
here:
https://guides.rubyonrails.org/routing.html#restricting-the-routes-created
The routing isn't a matter of this gem, so just ignore that for running the test.
This PR adds Rails 7.1 to the CI matrix to ensure the gem works with Rails 7.1.
This PR includes two commits to pass the test.
Ignore the directory that keeps factory files under the lib Some tests put factory files under the
lib
. But since Rails 7.1, Rails loadslib
directory by default in a new application. https://guides.rubyonrails.org/7_1_release_notes.html#introducing-config-autoload-lib-and-config-autoload-lib-once-for-enhanced-autoloading But factory files don't follow the naming rule of Zeitwerk. So Zeitwerk raisesZeitwerk::NameError
. To avoid the error, this changed to ignore the directory that puts factory files.Remove the route that is defined by default Some test code loads the route file twice. This wasn't a problem before Rails 7.0 because we didn't have a route. But, Rails 7.1 has one route by default. So the test application raises the following error during the load.
The routing isn't a matter of this gem, so just ignore that for running the test.