Sha256: 597a7fb503bce7c0572dccfdffdc668e39e1709cbc98236fbd99db64c2b0266f

Contents?: true

Size: 1.06 KB

Versions: 14

Compression:

Stored size: 1.06 KB

Contents

require 'test_helper'

module ActiveModel
  class Serializer
    class ConfigurationTest < ActiveSupport::TestCase
      def test_collection_serializer
        assert_equal ActiveModel::Serializer::CollectionSerializer, ActiveModelSerializers.config.collection_serializer
      end

      def test_array_serializer
        assert_equal ActiveModel::Serializer::CollectionSerializer, ActiveModelSerializers.config.array_serializer
      end

      def test_setting_array_serializer_sets_collection_serializer
        config = ActiveModelSerializers.config
        old_config = config.dup
        begin
          assert_equal ActiveModel::Serializer::CollectionSerializer, config.collection_serializer
          config.array_serializer = :foo
          assert_equal config.array_serializer, :foo
          assert_equal config.collection_serializer, :foo
        ensure
          ActiveModelSerializers.config.replace(old_config)
        end
      end

      def test_default_adapter
        assert_equal :attributes, ActiveModelSerializers.config.adapter
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
active_model_serializers-0.10.8 test/serializers/configuration_test.rb
active_model_serializers-0.10.7 test/serializers/configuration_test.rb
active_model_serializers-0.10.6 test/serializers/configuration_test.rb
active_model_serializers-0.10.5 test/serializers/configuration_test.rb
active_model_serializers-0.10.4 test/serializers/configuration_test.rb
agi_active_model_serializers-0.10.9 test/serializers/configuration_test.rb
agi_active_model_serializers-0.10.8 test/serializers/configuration_test.rb
agi_active_model_serializers-0.10.7 test/serializers/configuration_test.rb
active_model_serializers-0.10.3 test/serializers/configuration_test.rb
active_model_serializers-0.10.2 test/serializers/configuration_test.rb
active_model_serializers-0.10.1 test/serializers/configuration_test.rb
active_model_serializers-0.10.0 test/serializers/configuration_test.rb
active_model_serializers-0.10.0.rc5 test/serializers/configuration_test.rb
active_model_serializers-0.10.0.rc4 test/serializers/configuration_test.rb