Sha256: e9dd8b430b5a48f3374d5733c61e9ae44ff9cff19fceb06cb512885b4d3d737c

Contents?: true

Size: 607 Bytes

Versions: 13

Compression:

Stored size: 607 Bytes

Contents

require 'test_helper'

module ActiveModel
  class ArraySerializer
    class OnlyTest < Minitest::Test
      def test_array_serializer_pass_only_to_items_serializers
        array = [Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' }),
                 Profile.new({ name: 'Name 2', description: 'Description 2', comments: 'Comments 2' })]
        serializer = ArraySerializer.new(array, only: [:name])

        expected = [{ name: 'Name 1' },
                    { name: 'Name 2' }]

        assert_equal expected, serializer.serializable_array
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
active_model_serializers-0.9.13 test/unit/active_model/array_serializer/only_test.rb
active_model_serializers-0.9.12 test/unit/active_model/array_serializer/only_test.rb
active_model_serializers-0.9.11 test/unit/active_model/array_serializer/only_test.rb
active_model_serializers-0.9.9 test/unit/active_model/array_serializer/only_test.rb
active_model_serializers-0.9.8 test/unit/active_model/array_serializer/only_test.rb
active_model_serializers-0.9.7 test/unit/active_model/array_serializer/only_test.rb
active_model_serializers-0.9.6 test/unit/active_model/array_serializer/only_test.rb
active_model_serializers-0.9.5 test/unit/active_model/array_serializer/only_test.rb
active_model_serializers-0.9.4 test/unit/active_model/array_serializer/only_test.rb
active_model_serializers-0.9.3 test/unit/active_model/array_serializer/only_test.rb
active_model_serializers-0.9.2 test/unit/active_model/array_serializer/only_test.rb
active_model_serializers-0.9.1 test/unit/active_model/array_serializer/only_test.rb
active_model_serializers-0.9.0 test/unit/active_model/array_serializer/only_test.rb