mirror of
https://github.com/moparisthebest/mail
synced 2025-01-30 22:50:17 -05:00
Merge pull request #33 from whiteout-io/dev/outbox-date
add date to outbox
This commit is contained in:
commit
8d8003116c
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user