Skip to content

Commit

Permalink
Ignore the route that is defined by default
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
y-yagi committed Oct 27, 2023
1 parent ca9593b commit b189d32
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions features/support/rails_template
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ if Rails.gem_version < Gem::Version.new('6')
end

gsub_file "Gemfile", /^ gem 'spring'$/, ' gem "spring", "!= 2.1.1"'
gsub_file "config/routes.rb", /^ get/, ' # get'

0 comments on commit b189d32

Please sign in to comment.