Fix store.push deprecations in user model test

no issue
- `store.push` now accepts a single argument that is a JSON API compliant object (http://emberjs.com/blog/2015/06/18/ember-data-1-13-released.html#toc_internal-format-change-to-json-api)
This commit is contained in:
Kevin Ansfield 2015-11-12 15:18:08 +00:00
parent e6cef8fcb9
commit 2b2050bd27

View File

@ -74,13 +74,13 @@ describeModel(
var model = this.subject(); var model = this.subject();
run(() => { run(() => {
let role = this.store().push('role', {id: 1, name: 'Author'}); let role = this.store().push({data: {id: 1, type: 'role', attributes: {name: 'Author'}}});
model.get('roles').pushObject(role); model.get('roles').pushObject(role);
}); });
expect(model.get('role.name')).to.equal('Author'); expect(model.get('role.name')).to.equal('Author');
run(() => { run(() => {
let role = this.store().push('role', {id: 1, name: 'Editor'}); let role = this.store().push({data: {id: 1, type: 'role', attributes: {name: 'Editor'}}});
model.set('role', role); model.set('role', role);
}); });
expect(model.get('role.name')).to.equal('Editor'); expect(model.get('role.name')).to.equal('Editor');
@ -90,7 +90,7 @@ describeModel(
var model = this.subject(); var model = this.subject();
run(() => { run(() => {
let role = this.store().push('role', {id: 1, name: 'Author'}); let role = this.store().push({data: {id: 1, type: 'role', attributes: {name: 'Author'}}});
model.set('role', role); model.set('role', role);
}); });
expect(model.get('isAuthor')).to.be.ok; expect(model.get('isAuthor')).to.be.ok;
@ -103,7 +103,7 @@ describeModel(
var model = this.subject(); var model = this.subject();
run(() => { run(() => {
let role = this.store().push('role', {id: 1, name: 'Editor'}); let role = this.store().push({data: {id: 1, type: 'role', attributes: {name: 'Editor'}}});
model.set('role', role); model.set('role', role);
}); });
expect(model.get('isEditor')).to.be.ok; expect(model.get('isEditor')).to.be.ok;
@ -116,7 +116,7 @@ describeModel(
var model = this.subject(); var model = this.subject();
run(() => { run(() => {
let role = this.store().push('role', {id: 1, name: 'Administrator'}); let role = this.store().push({data: {id: 1, type: 'role', attributes: {name: 'Administrator'}}});
model.set('role', role); model.set('role', role);
}); });
expect(model.get('isAdmin')).to.be.ok; expect(model.get('isAdmin')).to.be.ok;
@ -129,7 +129,7 @@ describeModel(
var model = this.subject(); var model = this.subject();
run(() => { run(() => {
let role = this.store().push('role', {id: 1, name: 'Owner'}); let role = this.store().push({data: {id: 1, type: 'role', attributes: {name: 'Owner'}}});
model.set('role', role); model.set('role', role);
}); });
expect(model.get('isOwner')).to.be.ok; expect(model.get('isOwner')).to.be.ok;