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 135e532 commit 39673ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ end

appraise "rails7.1" do
gem "byebug"
gem "error_highlight", ">= 0.4.0"
gem "listen", "~> 3.2"
gem "puma", "~> 6.0"
gem "rails", "~> 7.1.0"
Expand Down
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'
1 change: 1 addition & 0 deletions gemfiles/rails7.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ source "https://rubygems.org"
gem "appraisal"
gem "aruba"
gem "cucumber"
gem "error_highlight", ">= 0.4.0"
gem "rake"
gem "rspec-rails"
gem "standard"
Expand Down

0 comments on commit 39673ba

Please sign in to comment.