diff options
author | Giovane <giovaneliberato@gmail.com> | 2015-11-27 21:12:19 -0200 |
---|---|---|
committer | Giovane <giovaneliberato@gmail.com> | 2015-11-27 21:12:58 -0200 |
commit | 935b1b6f1f200a995dc1f82391a26dfe59a87e50 (patch) | |
tree | dcd751443b0966e6b5dcda2f9accf3eacb44171a /web-ui/test/spec/mixins | |
parent | 230ac791547576850e886e1d927b400dbe65e505 (diff) |
Permanently delete discarded drafts #512 w/ bwagner
Diffstat (limited to 'web-ui/test/spec/mixins')
-rw-r--r-- | web-ui/test/spec/mixins/with_mail_edit_base.spec.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/web-ui/test/spec/mixins/with_mail_edit_base.spec.js b/web-ui/test/spec/mixins/with_mail_edit_base.spec.js index 2ad12361..f9e5600a 100644 --- a/web-ui/test/spec/mixins/with_mail_edit_base.spec.js +++ b/web-ui/test/spec/mixins/with_mail_edit_base.spec.js @@ -69,25 +69,26 @@ describeMixin('mixins/with_mail_edit_base', function () { }); describe('when user asks to discard the mail', function() { - var mailSaveSpy, mailDiscardSpy; + var mailDeleteSpy, mailDiscardSpy; beforeEach(function () { - mailSaveSpy = spyOnEvent(document, Pixelated.events.mail.save); + mailDeleteSpy = spyOnEvent(document, Pixelated.events.ui.mail.delete); mailDiscardSpy = spyOnEvent(document, Pixelated.events.ui.mail.discard); }); it('discards the mail if it was never saved', function() { delete this.component.attr.ident; - this.component.trashMail(); - expect(mailSaveSpy).not.toHaveBeenTriggeredOn(document); + this.component.discardMail(); + expect(mailDeleteSpy).not.toHaveBeenTriggeredOn(document); expect(mailDiscardSpy).toHaveBeenTriggeredOn(document); }); it('deletes the draft if it was saved before', function() { var spy = spyOnEvent(document, Pixelated.events.mail.save); this.component.attr.ident = 'ident'; - this.component.trashMail(); - expect(mailSaveSpy).toHaveBeenTriggeredOn(document); + this.component.discardMail(); + expect(mailDeleteSpy).toHaveBeenTriggeredOn(document); + expect(mailDiscardSpy).not.toHaveBeenTriggeredOn(document); }); }); |