Sha256: a9b4791ba31a7c86f66e9aaa62a75f8970b76a1a84a1a2bfdfb8aea7bc16a6de
Contents?: true
Size: 620 Bytes
Versions: 9
Compression:
Stored size: 620 Bytes
Contents
require 'test_helper' module ActiveModel class Serializer class FieldsetTest < Minitest::Test def test_fieldset_with_hash fieldset = ActiveModel::Serializer::Fieldset.new({'post' => ['id', 'title'], 'coment' => ['body']}) assert_equal( {:post=>[:id, :title], :coment=>[:body]}, fieldset.fields ) end def test_fieldset_with_array_of_fields_and_root_name fieldset = ActiveModel::Serializer::Fieldset.new(['title'], 'post') assert_equal( {:post => [:title]}, fieldset.fields ) end end end end
Version data entries
9 entries across 9 versions & 3 rubygems