Skip to content

Commit

Permalink
Merge pull request #39 from bmac/register-store-service
Browse files Browse the repository at this point in the history
Delegate to DS._setupContainer when available to register service:store
  • Loading branch information
rwjblue committed Apr 28, 2015
2 parents 532da8c + 1ea3671 commit 835c54b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
18 changes: 11 additions & 7 deletions lib/ember-test-helpers/isolated-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -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--) {
Expand Down
6 changes: 0 additions & 6 deletions lib/ember-test-helpers/test-module-for-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 835c54b

Please sign in to comment.