Sha256: 1035b97ecc5a8efd1442d66cbf8b5a6eb74310c7b37aa0500bcff5f5af18438f

Contents?: true

Size: 531 Bytes

Versions: 6

Compression:

Stored size: 531 Bytes

Contents

require 'test_helper'

module ActiveModel
  class Serializer
    class RootTest < Minitest::Test
      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

6 entries across 6 versions & 2 rubygems

Version Path
active_model_serializers-0.10.0.rc3 test/serializers/root_test.rb
cheap_ams-0.10.11 test/serializers/root_test.rb
cheap_ams-0.10.10 test/serializers/root_test.rb
cheap_ams-0.10.8 test/serializers/root_test.rb
cheap_ams-0.10.7 test/serializers/root_test.rb
cheap_ams-0.10.6 test/serializers/root_test.rb