[persistence] #58 renamed alertService to notificationService

This commit is contained in:
Henry 2015-12-04 10:45:49 -08:00
parent 00f96c314a
commit eb4959cf49
2 changed files with 8 additions and 8 deletions

View File

@ -48,7 +48,7 @@ define(
function PersistenceCapability(
persistenceService,
identifierService,
alertService,
notificationService,
$q,
domainObject
) {
@ -58,7 +58,7 @@ define(
this.domainObject = domainObject;
this.identifierService = identifierService;
this.persistenceService = persistenceService;
this.alertService = alertService;
this.notificationService = notificationService;
this.$q = $q;
}
@ -147,7 +147,7 @@ define(
]).then(function(result){
return rejectIfFalsey(result, self.$q);
}).catch(function(error){
return notifyOnError(error, domainObject, self.alertService, self.$q);
return notifyOnError(error, domainObject, self.notificationService, self.$q);
});
};

View File

@ -35,7 +35,7 @@ define(
mockIdentifierService,
mockDomainObject,
mockIdentifier,
mockAlertService,
mockNofificationService,
mockQ,
id = "object id",
model,
@ -77,7 +77,7 @@ define(
"$q",
["reject"]
);
mockAlertService = jasmine.createSpyObj(
mockNofificationService = jasmine.createSpyObj(
"notificationService",
["error"]
);
@ -98,7 +98,7 @@ define(
persistence = new PersistenceCapability(
mockPersistenceService,
mockIdentifierService,
mockAlertService,
mockNofificationService,
mockQ,
mockDomainObject
);
@ -168,7 +168,7 @@ define(
" persistence", function () {
persistence.persist();
expect(mockQ.reject).not.toHaveBeenCalled();
expect(mockAlertService.error).not.toHaveBeenCalled();
expect(mockNofificationService.error).not.toHaveBeenCalled();
});
});
describe("unsuccessful persistence", function() {
@ -188,7 +188,7 @@ define(
it("notifies user on persistence failure", function () {
persistence.persist();
expect(mockQ.reject).toHaveBeenCalled();
expect(mockAlertService.error).toHaveBeenCalled();
expect(mockNofificationService.error).toHaveBeenCalled();
});
});
});