fix(delete-category): Resolve regression in error message (#1244)

This commit is contained in:
Ben Gotow 2016-02-08 17:40:37 -08:00
parent f4e3137b5b
commit 52681baade
2 changed files with 9 additions and 1 deletions

View file

@ -118,3 +118,10 @@ describe "DestroyCategoryTask", ->
model = DatabaseTransaction.prototype.persistModel.calls[0].args[0]
expect(model.serverId).toEqual "server-444"
expect(model.isDeleted).toBe false
describe "_notifyUserOfError", ->
it "should present an error dialog", ->
spyOn(NylasEnv, 'showErrorDialog')
task = makeTask()
task._notifyUserOfError()
expect(NylasEnv.showErrorDialog).toHaveBeenCalled()

View file

@ -64,8 +64,9 @@ class DestroyCategoryTask extends Task
_notifyUserOfError: (category = @category) ->
displayName = category.displayName
displayType = category.displayType()
msg = "The #{category.displayType()} #{displayName} could not be deleted."
msg = "The #{displayType} #{displayName} could not be deleted."
if displayType is 'folder'
msg += " Make sure the folder you want to delete is empty before deleting it."