active_model_serializers/test/serializers/fieldset_test.rb
2018-12-17 16:54:56 +01:00

17 lines
417 B
Ruby

# frozen_string_literal: true
require 'test_helper'
module ActiveModel
class Serializer
class FieldsetTest < ActiveSupport::TestCase
def test_fieldset_with_hash
fieldset = ActiveModel::Serializer::Fieldset.new('post' => %w(id title), 'comment' => ['body'])
expected = { post: [:id, :title], comment: [:body] }
assert_equal(expected, fieldset.fields)
end
end
end
end