mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Prevent the clearing of instance variables after each test request with Rails 7
This commit is contained in:
parent
c1acc24b31
commit
5d64851ad0
13
test/support/rails_7_patch.rb
Normal file
13
test/support/rails_7_patch.rb
Normal file
@ -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
|
||||||
@ -49,6 +49,7 @@ end
|
|||||||
|
|
||||||
require 'support/rails_app'
|
require 'support/rails_app'
|
||||||
|
|
||||||
|
require 'support/rails_7_patch'
|
||||||
require 'support/ruby_2_6_rails_4_2_patch'
|
require 'support/ruby_2_6_rails_4_2_patch'
|
||||||
|
|
||||||
# require "rails/test_help"
|
# require "rails/test_help"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user