From 1ea36714d44cdfd3fd7202218f97a42090c2004d Mon Sep 17 00:00:00 2001 From: bmac Date: Fri, 17 Apr 2015 11:17:04 -0400 Subject: [PATCH] Delegate to DS._setupContainer when avalible --- lib/ember-test-helpers/isolated-container.js | 18 +++++++++++------- .../test-module-for-model.js | 6 ------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/lib/ember-test-helpers/isolated-container.js b/lib/ember-test-helpers/isolated-container.js index 2effd510d..5417bcc9d 100644 --- a/lib/ember-test-helpers/isolated-container.js +++ b/lib/ember-test-helpers/isolated-container.js @@ -69,13 +69,17 @@ export default function isolatedContainer(fullNames) { var globalContext = typeof global === 'object' && global || self; if (globalContext.DS) { var DS = globalContext.DS; - container.register('transform:boolean', DS.BooleanTransform); - container.register('transform:date', DS.DateTransform); - container.register('transform:number', DS.NumberTransform); - container.register('transform:string', DS.StringTransform); - container.register('serializer:-default', DS.JSONSerializer); - container.register('serializer:-rest', DS.RESTSerializer); - container.register('adapter:-rest', DS.RESTAdapter); + if (DS._setupContainer) { + DS._setupContainer(container); + } else { + container.register('transform:boolean', DS.BooleanTransform); + container.register('transform:date', DS.DateTransform); + container.register('transform:number', DS.NumberTransform); + container.register('transform:string', DS.StringTransform); + container.register('serializer:-default', DS.JSONSerializer); + container.register('serializer:-rest', DS.RESTSerializer); + container.register('adapter:-rest', DS.RESTAdapter); + } } for (var i = fullNames.length; i > 0; i--) { diff --git a/lib/ember-test-helpers/test-module-for-model.js b/lib/ember-test-helpers/test-module-for-model.js index dc208ed9c..cd7ca4ca2 100644 --- a/lib/ember-test-helpers/test-module-for-model.js +++ b/lib/ember-test-helpers/test-module-for-model.js @@ -16,12 +16,6 @@ export default TestModule.extend({ var callbacks = this.callbacks; var modelName = this.modelName; - if (DS._setupContainer) { - DS._setupContainer(container); - } else { - container.register('store:main', DS.Store); - } - var adapterFactory = container.lookupFactory('adapter:application'); if (!adapterFactory) { container.register('adapter:application', DS.FixtureAdapter);