mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
- Better minitest 4/5 support - Better DSL - Already available with no changes - Consistent interface
15 lines
392 B
Ruby
15 lines
392 B
Ruby
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
|