mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
25 lines
573 B
Ruby
25 lines
573 B
Ruby
# frozen_string_literal: true
|
|
|
|
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
|