Split basic object and model array serialization tests

This commit is contained in:
Adrian Mugnolo and Santiago Pastorino 2013-12-16 16:48:39 -02:00 committed by Santiago Pastorino
parent 5c00ce0443
commit af7437b7e4

View File

@ -2,7 +2,7 @@ require 'test_helper'
module ActiveModel
class ArraySerializer
class SerializeTest < ActiveModel::TestCase
class BasicObjectsSerializationTest < ActiveModel::TestCase
def setup
array = [1, 2, 3]
@serializer = ActiveModel::Serializer.serializer_for(array).new(array)
@ -16,7 +16,9 @@ module ActiveModel
assert_equal [1, 2, 3], @serializer.serializable_array
assert_equal [1, 2, 3], @serializer.as_json
end
end
class ModelSerializationTest < ActiveModel::TestCase
def test_array_serializer_serializes_models
array = [Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' }),
Profile.new({ name: 'Name 2', description: 'Description 2', comments: 'Comments 2' })]