Merge pull request #33 from whiteout-io/dev/outbox-date

add date to outbox
This commit is contained in:
Tankred Hase 2014-03-07 12:30:02 +01:00
commit 8d8003116c
3 changed files with 17 additions and 7 deletions

View File

@ -226,7 +226,8 @@ define(function(require) {
bcc: $scope.bcc.filter(filterEmptyAddresses),
subject: $scope.subject.trim() ? $scope.subject.trim() : str.fallbackSubject, // Subject line, or the fallback subject, if nothing valid was entered
body: $scope.body.trim() + (!$scope.sendBtnSecure ? str.signature : ''), // use parsed plaintext body
attachments: $scope.attachments
attachments: $scope.attachments,
sentDate: new Date()
};
// close the writer

View File

@ -84,8 +84,6 @@ define(function() {
// put uid in key if available... for easy querying
if (i.uid) {
key = type + '_' + i.uid;
} else if (i.sentDate && i.id) {
key = type + '_' + i.sentDate + '_' + i.id;
} else if (i.id) {
key = type + '_' + i.id;
} else {

View File

@ -272,9 +272,6 @@ define(function(require) {
describe('send to outbox', function() {
it('should work', function() {
scope.from = [{
address: 'pity@dafool'
}];
scope.to = [{
address: 'pity@dafool'
}];
@ -289,7 +286,21 @@ define(function(require) {
scope.replyTo = {};
outboxMock.put.yields();
outboxMock.put.withArgs(sinon.match(function(mail) {
expect(mail.from).to.deep.equal([{
address: emailAddress
}]);
expect(mail.to).to.deep.equal(scope.to);
expect(mail.cc).to.deep.equal(scope.cc);
expect(mail.bcc).to.deep.equal(scope.bcc);
expect(mail.body).to.contain(scope.body);
expect(mail.subject).to.equal(scope.subject);
expect(mail.attachments).to.be.empty;
expect(mail.sentDate).to.exist;
return true;
})).yields();
emailDaoMock.sync.yields();
scope.onError = function(err) {