From a94763041efc0a464b142ab9b38b8bfc8c510fa8 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Wed, 19 Aug 2015 13:16:36 -0700 Subject: [PATCH] [Move] correct logic and specification --- platform/entanglement/src/services/MoveService.js | 2 +- platform/entanglement/test/services/MoveServiceSpec.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/entanglement/src/services/MoveService.js b/platform/entanglement/src/services/MoveService.js index 9dc8b80169..e6e1238979 100644 --- a/platform/entanglement/src/services/MoveService.js +++ b/platform/entanglement/src/services/MoveService.js @@ -75,7 +75,7 @@ define( oldLocationCapability = object .getCapability('location'); if (!newLocationCapability || - oldLocationCapability) { + !oldLocationCapability) { return; } diff --git a/platform/entanglement/test/services/MoveServiceSpec.js b/platform/entanglement/test/services/MoveServiceSpec.js index fed7878ac7..02494a0afb 100644 --- a/platform/entanglement/test/services/MoveServiceSpec.js +++ b/platform/entanglement/test/services/MoveServiceSpec.js @@ -162,7 +162,8 @@ define( 'locationCapability', [ 'isOriginal', - 'setPrimaryLocation' + 'setPrimaryLocation', + 'getContextualLocation' ] ); @@ -195,13 +196,15 @@ define( describe("when moving an original", function () { beforeEach(function () { + locationCapability.getContextualLocation + .andReturn('new-location'); locationCapability.isOriginal.andReturn(true); linkService.perform.mostRecentCall.promise.resolve(); }); it("updates location", function () { expect(locationCapability.setPrimaryLocation) - .toHaveBeenCalled(); + .toHaveBeenCalledWith('new-location'); }); describe("after location update", function () {