Sha256: 99e2c00361a5664a488e299d6340a85b272d0d9dddc00dc1f1515dd0ebd773b1

Contents?: true

Size: 547 Bytes

Versions: 3

Compression:

Stored size: 547 Bytes

Contents

require 'test_helper'

module ActiveModelSerializers
  module Adapter
    class NullTest < ActiveSupport::TestCase
      def setup
        profile = Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' })
        serializer = ProfileSerializer.new(profile)

        @adapter = Null.new(serializer)
      end

      def test_serializable_hash
        assert_equal({}, @adapter.serializable_hash)
      end

      def test_it_returns_empty_json
        assert_equal('{}', @adapter.to_json)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_model_serializers-0.10.1 test/adapter/null_test.rb
active_model_serializers-0.10.0 test/adapter/null_test.rb
active_model_serializers-0.10.0.rc5 test/adapter/null_test.rb