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
44
44
end
45
45
# :nocov:
46
46
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
+
47
55
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
50
60
end
51
61
end
52
62
end
You can’t perform that action at this time.
0 commit comments