diff --git a/test/adapter/json_api/resource_type_config_test.rb b/test/adapter/json_api/resource_type_config_test.rb index c5802a03..1f2f534d 100644 --- a/test/adapter/json_api/resource_type_config_test.rb +++ b/test/adapter/json_api/resource_type_config_test.rb @@ -28,8 +28,8 @@ module ActiveModel end def with_jsonapi_resource_type type - old_type = ActiveModel::Serializer.config[:jsonapi_resource_type] - ActiveModel::Serializer.config[:jsonapi_resource_type] = type + old_type = ActiveModel::Serializer.config.jsonapi_resource_type + ActiveModel::Serializer.config.jsonapi_resource_type = type yield ensure ActiveModel::Serializer.config.jsonapi_resource_type = old_type @@ -38,7 +38,7 @@ module ActiveModel def test_config_plural with_adapter :json_api do with_jsonapi_resource_type :plural do - hash = ActiveModel::SerializableResource.serialize(@comment).serializable_hash + hash = ActiveModel::SerializableResource.new(@comment).serializable_hash assert_equal('comments', hash[:data][:type]) end end @@ -47,7 +47,7 @@ module ActiveModel def test_config_singular with_adapter :json_api do with_jsonapi_resource_type :singular do - hash = ActiveModel::SerializableResource.serialize(@comment).serializable_hash + hash = ActiveModel::SerializableResource.new(@comment).serializable_hash assert_equal('comment', hash[:data][:type]) end end