@@ -44,7 +44,7 @@ class BasicModelTest < ActiveSupport::TestCase
4444 end
4545
4646 def test_initialization_with_string_keys
47- klass = subclass_without_caching_support do
47+ klass = poro_without_caching_support do
4848 attributes :key
4949 end
5050 value = 'value'
@@ -55,7 +55,7 @@ def test_initialization_with_string_keys
5555 end
5656
5757 def test_attributes_can_be_read_for_serialization
58- klass = subclass_without_caching_support do
58+ klass = poro_without_caching_support do
5959 attributes :one , :two , :three
6060 end
6161 original_attributes = { one : 1 , two : 2 , three : 3 }
@@ -77,18 +77,8 @@ def test_attributes_can_be_read_for_serialization
7777 end
7878
7979 def test_does_not_include_caching_module
80- klass = subclass_without_caching_support
80+ klass = poro_without_caching_support
8181 refute klass . included_modules . include? ( ActiveModelSerializers ::Model ::Caching )
8282 end
83-
84- def subclass_without_caching_support ( &block )
85- original_caching_support = ActiveModelSerializers ::Model . add_caching_support
86- ActiveModelSerializers ::Model . add_caching_support = false
87- Class . new ( ActiveModelSerializers ::Model ) do
88- instance_exec ( &block ) if block
89- end
90- ensure
91- ActiveModelSerializers ::Model . add_caching_support = original_caching_support
92- end
9383 end
9484end
0 commit comments