Sha256: eeb73496b5a5e5365bd665c7a98c5f43cb029664ca64e0adfc4b892fb5b7797a

Contents?: true

Size: 640 Bytes

Versions: 13

Compression:

Stored size: 640 Bytes

Contents

require 'test_helper'

module ActiveModel
  class ArraySerializer
    class KeyFormatTest < Minitest::Test
      def test_array_serializer_pass_options_to_items_serializers
        array = [WebLog.new({ name: 'Name 1', display_name: 'Display Name 1'}),
                 WebLog.new({ name: 'Name 2', display_name: 'Display Name 2'})]
        serializer = ArraySerializer.new(array, key_format: :lower_camel)

        expected = [{ name: 'Name 1', displayName: 'Display Name 1' },
                    { name: 'Name 2', displayName: 'Display 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/key_format_test.rb
active_model_serializers-0.9.12 test/unit/active_model/array_serializer/key_format_test.rb
active_model_serializers-0.9.11 test/unit/active_model/array_serializer/key_format_test.rb
active_model_serializers-0.9.9 test/unit/active_model/array_serializer/key_format_test.rb
active_model_serializers-0.9.8 test/unit/active_model/array_serializer/key_format_test.rb
active_model_serializers-0.9.7 test/unit/active_model/array_serializer/key_format_test.rb
active_model_serializers-0.9.6 test/unit/active_model/array_serializer/key_format_test.rb
active_model_serializers-0.9.5 test/unit/active_model/array_serializer/key_format_test.rb
active_model_serializers-0.9.4 test/unit/active_model/array_serializer/key_format_test.rb
active_model_serializers-0.9.3 test/unit/active_model/array_serializer/key_format_test.rb
active_model_serializers-0.9.2 test/unit/active_model/array_serializer/key_format_test.rb
active_model_serializers-0.9.1 test/unit/active_model/array_serializer/key_format_test.rb
active_model_serializers-0.9.0 test/unit/active_model/array_serializer/key_format_test.rb