Sha256: 8e1e0e219fe5aaa08fb2aa349024e7eaef5d2badcb9e60b3ccb13abfb13b5b2d

Contents?: true

Size: 567 Bytes

Versions: 2

Compression:

Stored size: 567 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

module ActiveModel
  class Serializer
    class RootTest < ActiveSupport::TestCase
      def setup
        @virtual_value = VirtualValue.new(id: 1)
      end

      def test_overwrite_root
        serializer = VirtualValueSerializer.new(@virtual_value, root: 'smth')
        assert_equal('smth', serializer.json_key)
      end

      def test_underscore_in_root
        serializer = VirtualValueSerializer.new(@virtual_value)
        assert_equal('virtual_value', serializer.json_key)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
active_model_serializers_custom-0.10.90 test/serializers/root_test.rb
active_model_serializers-0.10.9 test/serializers/root_test.rb