Sha256: b57ec7989de8b3f006abd62fb5b6186b392714f84e8dafdfcb4c944d89908706

Contents?: true

Size: 536 Bytes

Versions: 10

Compression:

Stored size: 536 Bytes

Contents

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

10 entries across 10 versions & 2 rubygems

Version Path
active_model_serializers-0.10.8 test/serializers/root_test.rb
active_model_serializers-0.10.7 test/serializers/root_test.rb
active_model_serializers-0.10.6 test/serializers/root_test.rb
active_model_serializers-0.10.5 test/serializers/root_test.rb
active_model_serializers-0.10.4 test/serializers/root_test.rb
agi_active_model_serializers-0.10.9 test/serializers/root_test.rb
agi_active_model_serializers-0.10.8 test/serializers/root_test.rb
agi_active_model_serializers-0.10.7 test/serializers/root_test.rb
active_model_serializers-0.10.3 test/serializers/root_test.rb
active_model_serializers-0.10.2 test/serializers/root_test.rb