mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 14:56: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
|
class CustomArraySerializerSupport < Minitest::Test
|
||||||
def setup
|
def setup
|
||||||
Object.const_set(:ArraySerializer, Class.new{ def initialize(*); end })
|
Object.const_set(:ArraySerializer, Class.new)
|
||||||
|
|
||||||
array = [1, 2, 3]
|
array = [1, 2, 3]
|
||||||
@serializer = Serializer.serializer_for(array).new(array)
|
@serializer_class = Serializer.serializer_for(array)
|
||||||
end
|
end
|
||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
@ -31,7 +31,7 @@ module ActiveModel
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_serializer_for_array_returns_appropriate_type
|
def test_serializer_for_array_returns_appropriate_type
|
||||||
assert_kind_of ::ArraySerializer, @serializer
|
assert_equal ::ArraySerializer, @serializer_class
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user