[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( function PersistenceCapability(
persistenceService, persistenceService,
identifierService, identifierService,
alertService, notificationService,
$q, $q,
domainObject domainObject
) { ) {
@ -58,7 +58,7 @@ define(
this.domainObject = domainObject; this.domainObject = domainObject;
this.identifierService = identifierService; this.identifierService = identifierService;
this.persistenceService = persistenceService; this.persistenceService = persistenceService;
this.alertService = alertService; this.notificationService = notificationService;
this.$q = $q; this.$q = $q;
} }
@ -147,7 +147,7 @@ define(
]).then(function(result){ ]).then(function(result){
return rejectIfFalsey(result, self.$q); return rejectIfFalsey(result, self.$q);
}).catch(function(error){ }).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, mockIdentifierService,
mockDomainObject, mockDomainObject,
mockIdentifier, mockIdentifier,
mockAlertService, mockNofificationService,
mockQ, mockQ,
id = "object id", id = "object id",
model, model,
@ -77,7 +77,7 @@ define(
"$q", "$q",
["reject"] ["reject"]
); );
mockAlertService = jasmine.createSpyObj( mockNofificationService = jasmine.createSpyObj(
"notificationService", "notificationService",
["error"] ["error"]
); );
@ -98,7 +98,7 @@ define(
persistence = new PersistenceCapability( persistence = new PersistenceCapability(
mockPersistenceService, mockPersistenceService,
mockIdentifierService, mockIdentifierService,
mockAlertService, mockNofificationService,
mockQ, mockQ,
mockDomainObject mockDomainObject
); );
@ -168,7 +168,7 @@ define(
" persistence", function () { " persistence", function () {
persistence.persist(); persistence.persist();
expect(mockQ.reject).not.toHaveBeenCalled(); expect(mockQ.reject).not.toHaveBeenCalled();
expect(mockAlertService.error).not.toHaveBeenCalled(); expect(mockNofificationService.error).not.toHaveBeenCalled();
}); });
}); });
describe("unsuccessful persistence", function() { describe("unsuccessful persistence", function() {
@ -188,7 +188,7 @@ define(
it("notifies user on persistence failure", function () { it("notifies user on persistence failure", function () {
persistence.persist(); persistence.persist();
expect(mockQ.reject).toHaveBeenCalled(); expect(mockQ.reject).toHaveBeenCalled();
expect(mockAlertService.error).toHaveBeenCalled(); expect(mockNofificationService.error).toHaveBeenCalled();
}); });
}); });
}); });