44class RailtieTest < ActiveSupport ::TestCase
55 include ActiveSupport ::Testing ::Isolation
66
7- class WithRails < RailtieTest
7+ class WithRailsRequiredFirst < RailtieTest
88 setup do
99 require 'rails'
1010 require 'active_model_serializers'
11- make_basic_app
11+ make_basic_app do |app |
12+ app . config . action_controller . perform_caching = true
13+ end
1214 end
1315
1416 test 'mixes ActionController::Serialization into ActionController::Base' do
@@ -32,17 +34,17 @@ class WithRails < RailtieTest
3234
3335 test 'it is configured for caching' do
3436 assert_equal ActionController ::Base . cache_store , ActiveModelSerializers . config . cache_store
35- expected = Rails . configuration . action_controller . perform_caching
36- actual = ActiveModelSerializers . config . perform_caching
37- assert_nil expected
38- assert_nil actual
37+ assert_equal true , Rails . configuration . action_controller . perform_caching
38+ assert_equal true , ActiveModelSerializers . config . perform_caching
3939 end
4040 end
4141
42- class WithoutRails < RailtieTest
42+ class WithoutRailsRequiredFirst < RailtieTest
4343 setup do
4444 require 'active_model_serializers'
45- make_basic_app
45+ make_basic_app do |app |
46+ app . config . action_controller . perform_caching = true
47+ end
4648 end
4749
4850 test 'does not mix ActionController::Serialization into ActionController::Base' do
@@ -59,8 +61,8 @@ class WithoutRails < RailtieTest
5961 test 'it is not configured for caching' do
6062 refute_nil ActionController ::Base . cache_store
6163 assert_nil ActiveModelSerializers . config . cache_store
62- refute Rails . configuration . action_controller . perform_caching
63- refute ActiveModelSerializers . config . perform_caching
64+ assert_equal true , Rails . configuration . action_controller . perform_caching
65+ assert_nil ActiveModelSerializers . config . perform_caching
6466 end
6567 end
6668end
0 commit comments