From 3969de40e93ef3b4d3e85c094e9cc4238225a309 Mon Sep 17 00:00:00 2001 From: The Game Date: Mon, 11 Jul 2016 09:47:32 +0100 Subject: [PATCH] fixed and simplified test --- .../model/relationships/belongs-to-test.js | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/tests/unit/model/relationships/belongs-to-test.js b/tests/unit/model/relationships/belongs-to-test.js index c82581dcac5..b852b37aa37 100644 --- a/tests/unit/model/relationships/belongs-to-test.js +++ b/tests/unit/model/relationships/belongs-to-test.js @@ -192,14 +192,10 @@ test("when response to saving a belongsTo is a success but includes changes that let user = store.peekRecord('user', '1'); - assert.equal(get(user, 'tag.id'), '1', 'confirm local state'); - run(function() { user.set('tag', store.peekRecord('tag', '2')); }); - assert.equal(get(user, 'tag.id'), '2', 'expected local state to reflect the last set'); - env.adapter.updateRecord = function() { return { type: 'user', @@ -209,22 +205,8 @@ test("when response to saving a belongsTo is a success but includes changes that }; run(function() { - user.save().then(assert.wait(function() { - assert.equal(get(user, 'tag.id'), '1', 'expected new server state to be applied'); - })); - }); - - env.adapter.findRecord = function() { - return { - type: 'user', - id: '1', - tag: { type: 'tag', id: '1' } - }; - }; - - run(function() { - user.reload().then(assert.wait(function() { - assert.equal(get(user, 'tag.id'), '1', 'expected new server state to be applied'); + user.save().then(assert.wait(function(user) { + assert.equal(user.get('tag.id'), '1', 'expected new server state to be applied'); })); }); });