mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
No need to instantiate serializer
This commit is contained in:
parent
c389ae2207
commit
6869cc9c3b
@ -20,10 +20,10 @@ module ActiveModel
|
||||
|
||||
class CustomArraySerializerSupport < Minitest::Test
|
||||
def setup
|
||||
Object.const_set(:ArraySerializer, Class.new{ def initialize(*); end })
|
||||
Object.const_set(:ArraySerializer, Class.new)
|
||||
|
||||
array = [1, 2, 3]
|
||||
@serializer = Serializer.serializer_for(array).new(array)
|
||||
@serializer_class = Serializer.serializer_for(array)
|
||||
end
|
||||
|
||||
def teardown
|
||||
@ -31,7 +31,7 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def test_serializer_for_array_returns_appropriate_type
|
||||
assert_kind_of ::ArraySerializer, @serializer
|
||||
assert_equal ::ArraySerializer, @serializer_class
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user