diff --git a/test/support/rails_7_patch.rb b/test/support/rails_7_patch.rb new file mode 100644 index 00000000..b2cc74ab --- /dev/null +++ b/test/support/rails_7_patch.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# HACK: to prevent the resetting of instance variables after each request in Rails 7 +# see https://github.com/rails/rails/pull/43735 +if Rails::VERSION::MAJOR >= 7 + module ActionController + module Testing + module Functional + def clear_instance_variables_between_requests; end + end + end + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb index 7d8ca63e..00123504 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -49,6 +49,7 @@ end require 'support/rails_app' +require 'support/rails_7_patch' require 'support/ruby_2_6_rails_4_2_patch' # require "rails/test_help"