[Location] setPrimaryLocation takes location.

Rename "persistLocation" to be more clearly named, and make it take an
argument to allow for greater control outside the capability.
This commit is contained in:
Pete Richards
2015-08-19 11:15:09 -07:00
parent eb776e69c0
commit 9cf30f4213
4 changed files with 28 additions and 14 deletions

View File

@@ -162,12 +162,13 @@ define(
'locationCapability',
[
'isOriginal',
'persistLocation'
'setPrimaryLocation'
]
);
locationPromise = new ControlledPromise();
locationCapability.persistLocation.andReturn(locationPromise);
locationCapability.setPrimaryLocation
.andReturn(locationPromise);
object = domainObjectFactory({
name: 'object',
@@ -199,7 +200,7 @@ define(
});
it("updates location", function () {
expect(locationCapability.persistLocation)
expect(locationCapability.setPrimaryLocation)
.toHaveBeenCalled();
});
@@ -223,7 +224,7 @@ define(
});
it("does not update location", function () {
expect(locationCapability.persistLocation)
expect(locationCapability.setPrimaryLocation)
.not
.toHaveBeenCalled();
});