Sha256: 0ffe549d59a498e80156df3cca7df6a95f014b05d644dd7b077fa066cd695977

Contents?: true

Size: 576 Bytes

Versions: 1

Compression:

Stored size: 576 Bytes

Contents

require 'test_helper'

module ActiveModel
  class Serializer
    class AssociationsTest < ActiveModel::TestCase
      def test_associations_inheritance
        inherited_serializer_klass = Class.new(PostSerializer) do
          has_many :users
        end
        another_inherited_serializer_klass = Class.new(PostSerializer)

        assert_equal([:comments, :users],
                     inherited_serializer_klass._associations.keys)
        assert_equal([:comments],
                     another_inherited_serializer_klass._associations.keys)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_model_serializers-0.9.0.alpha1 test/unit/active_model/serializer/associations_test.rb