1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-25 18:32:20 -05:00
This commit is contained in:
Felix Hammerl 2013-12-02 19:48:35 +01:00
parent 4ff88694d4
commit 8e88ae7f99
2 changed files with 38 additions and 2 deletions

View File

@ -500,6 +500,14 @@ define(function(require) {
}, callback);
};
EmailDAO.prototype.move = function(options, callback) {
this._imapClient.moveMessage({
path: options.folder,
uid: options.uid,
destination: options.destination
}, callback);
};
EmailDAO.prototype.sendEncrypted = function(options, callback) {
var self = this,
email = options.email;

View File

@ -1139,7 +1139,11 @@ define(function(require) {
describe('markAsRead', function() {
it('should work', function(done) {
imapClientStub.updateFlags.yields();
imapClientStub.updateFlags.withArgs({
path: 'asdf',
uid: 1,
unread: false
}).yields();
dao.markRead({
folder: 'asdf',
@ -1154,7 +1158,11 @@ define(function(require) {
describe('markAsAnswered', function() {
it('should work', function(done) {
imapClientStub.updateFlags.yields();
imapClientStub.updateFlags.withArgs({
path: 'asdf',
uid: 1,
answered: true
}).yields();
dao.markAnswered({
folder: 'asdf',
@ -1167,6 +1175,26 @@ define(function(require) {
});
});
describe('move', function() {
it('should work', function(done) {
imapClientStub.moveMessage.withArgs({
path: 'asdf',
uid: 1,
destination: 'asdasd'
}).yields();
dao.move({
folder: 'asdf',
uid: 1,
destination: 'asdasd'
}, function(err) {
expect(imapClientStub.moveMessage.calledOnce).to.be.true;
expect(err).to.not.exist;
done();
});
});
});
describe('sendPlaintext', function() {
it('should work', function(done) {
smtpClientStub.send.withArgs(dummyEncryptedMail).yields();