File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 75
75
bundle exec rake
76
76
env :
77
77
RAILS_VERSION : ${{ matrix.rails-version }}
78
+ RAILS_ENV : test
Original file line number Diff line number Diff line change 9
9
begin
10
10
require 'action_controller'
11
11
require 'action_controller/serialization'
12
- require 'action_controller/serialization_test_case'
13
12
14
13
ActiveSupport . on_load ( :action_controller ) do
15
14
if ::ActionController ::Serialization . enabled
16
15
ActionController ::Base . send ( :include , ::ActionController ::Serialization )
17
- ActionController ::TestCase . send ( :include , ::ActionController ::SerializationAssertions )
16
+
17
+ # action_controller_test_case load hook was added in Rails 5.1
18
+ # https://github.com/rails/rails/commit/0510208dd1ff23baa619884c0abcae4d141fae53
19
+ if ActiveSupport ::VERSION ::STRING < '5.1'
20
+ require 'action_controller/serialization_test_case'
21
+ ActionController ::TestCase . send ( :include , ::ActionController ::SerializationAssertions )
22
+ else
23
+ ActiveSupport . on_load ( :action_controller_test_case ) do
24
+ require 'action_controller/serialization_test_case'
25
+ ActionController ::TestCase . send ( :include , ::ActionController ::SerializationAssertions )
26
+ end
27
+ end
18
28
end
19
29
end
20
30
rescue LoadError
You can’t perform that action at this time.
0 commit comments