File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
lib/active_model_serializers Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,19 @@ class Railtie < Rails::Railtie
4444 end
4545 # :nocov:
4646
47+ def extend_action_controller_test_case ( &block )
48+ if Rails ::VERSION ::MAJOR >= 6 || Rails ::VERSION ::MAJOR == 5 && Rails ::VERSION ::MINOR >= 2
49+ ActiveSupport . on_load ( :action_controller_test_case , run_once : true , &block )
50+ else
51+ ActionController ::TestCase . instance_eval ( &block )
52+ end
53+ end
54+
4755 if Rails . env . test?
48- ActionController ::TestCase . send ( :include , ActiveModelSerializers ::Test ::Schema )
49- ActionController ::TestCase . send ( :include , ActiveModelSerializers ::Test ::Serializer )
56+ extend_action_controller_test_case do
57+ include ActiveModelSerializers ::Test ::Schema
58+ include ActiveModelSerializers ::Test ::Serializer
59+ end
5060 end
5161 end
5262end
You can’t perform that action at this time.
0 commit comments