diff --git a/platform/core/src/capabilities/PersistenceCapability.js b/platform/core/src/capabilities/PersistenceCapability.js index 74e9d421ec..637be193c2 100644 --- a/platform/core/src/capabilities/PersistenceCapability.js +++ b/platform/core/src/capabilities/PersistenceCapability.js @@ -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); }); }; diff --git a/platform/core/test/capabilities/PersistenceCapabilitySpec.js b/platform/core/test/capabilities/PersistenceCapabilitySpec.js index aad76c4233..5b46ca3890 100644 --- a/platform/core/test/capabilities/PersistenceCapabilitySpec.js +++ b/platform/core/test/capabilities/PersistenceCapabilitySpec.js @@ -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(); }); }); });