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 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.
  • Loading branch information
zzak committed Apr 19, 2024
1 parent d229a54 commit 63f3189
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
private
def create_new_rails_app(app_dir, options=[])
Expand Down

0 comments on commit 63f3189

Please sign in to comment.