[Move] correct logic and specification

This commit is contained in:
Pete Richards 2015-08-19 13:16:36 -07:00
parent 26892e7104
commit a94763041e
2 changed files with 6 additions and 3 deletions

View File

@ -75,7 +75,7 @@ define(
oldLocationCapability = object
.getCapability('location');
if (!newLocationCapability ||
oldLocationCapability) {
!oldLocationCapability) {
return;
}

View File

@ -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 () {