Skip to content

Commit

Permalink
Monkey-patch AppName#valid_const? on older Rails (< 7.1)
Browse files Browse the repository at this point in the history
My hunch is that this was fixed in Rails 7.1 by #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.
  • Loading branch information
zzak committed Jan 11, 2024
1 parent 9c8ccb7 commit 6d75e14
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/app_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
def self.included(base)
base.include ActiveSupport::Testing::Isolation
Expand Down

0 comments on commit 6d75e14

Please sign in to comment.