Sha256: 3248c966bc53d772a02c08233eb398b2f8a050a53d5ee9be547b97fbe6ec6e34

Contents?: true

Size: 569 Bytes

Versions: 6

Compression:

Stored size: 569 Bytes

Contents

require 'test_helper'

module ActiveModel
  class Serializer
    class AssociationsTest < Minitest::Test
      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

6 entries across 6 versions & 2 rubygems

Version Path
active_model_serializers-0.9.4 test/unit/active_model/serializer/associations_test.rb
active_model_serializers-0.9.3 test/unit/active_model/serializer/associations_test.rb
active_model_serializers-0.9.2 test/unit/active_model/serializer/associations_test.rb
active_model_serializers-0.9.1 test/unit/active_model/serializer/associations_test.rb
active_model_serializers-0.9.0 test/unit/active_model/serializer/associations_test.rb
active_model_serializers_rails_2.3-0.9.0.alpha1 test/unit/active_model/serializer/associations_test.rb