Sha256: 824d952f90a6c0f43f461fa3495664ac82111a467d0b9dad6f437237c8b9d6fb

Contents?: true

Size: 386 Bytes

Versions: 10

Compression:

Stored size: 386 Bytes

Contents

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

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
active_model_serializers-0.10.8 test/serializers/fieldset_test.rb
active_model_serializers-0.10.7 test/serializers/fieldset_test.rb
active_model_serializers-0.10.6 test/serializers/fieldset_test.rb
active_model_serializers-0.10.5 test/serializers/fieldset_test.rb
active_model_serializers-0.10.4 test/serializers/fieldset_test.rb
agi_active_model_serializers-0.10.9 test/serializers/fieldset_test.rb
agi_active_model_serializers-0.10.8 test/serializers/fieldset_test.rb
agi_active_model_serializers-0.10.7 test/serializers/fieldset_test.rb
active_model_serializers-0.10.3 test/serializers/fieldset_test.rb
active_model_serializers-0.10.2 test/serializers/fieldset_test.rb