Skip to content

Commit 63f3189

Browse files
committed
Monkey-patch AppName#valid_const? on older Rails (< 7.1)
My hunch is that this was fixed in Rails 7.1 by rails/rails#46074, but I'm less concerned here because this test suite uses a Dummy app for all of the tests. This is a problem I've been working on in rails/rails#50427, to remove the dummy applications and replace them with a generated app like we've done here with the installer test. I'm happy to investigate replacing the dummy app here afterwards.
1 parent d229a54 commit 63f3189

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/app_helper.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
require "rails/test_help"
33
require "fileutils"
44

5+
if Gem::Version.new(Rails.version) < Gem::Version.new("7.1")
6+
module Rails::Generators::AppName
7+
private
8+
def valid_const?
9+
true
10+
end
11+
end
12+
end
13+
514
module RailsAppHelpers
615
private
716
def create_new_rails_app(app_dir, options=[])

0 commit comments

Comments
 (0)