From 63f3189a83aba6d172c1009ce3f9b370e6de25a0 Mon Sep 17 00:00:00 2001 From: zzak Date: Thu, 11 Jan 2024 18:35:15 +0900 Subject: [PATCH] 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. --- test/app_helper.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/app_helper.rb b/test/app_helper.rb index 154131d0..4587bf04 100644 --- a/test/app_helper.rb +++ b/test/app_helper.rb @@ -2,6 +2,15 @@ require "rails/test_help" require "fileutils" +if Gem::Version.new(Rails.version) < Gem::Version.new("7.1") + module Rails::Generators::AppName + private + def valid_const? + true + end + end +end + module RailsAppHelpers private def create_new_rails_app(app_dir, options=[])