mirror of
https://github.com/moparisthebest/mail
synced 2025-01-30 22:50:17 -05:00
[WO-183] key file export now proposes file name whiteout_mail_foo@bar.com_KEYIDKEYID.asc
This commit is contained in:
parent
8f366ffb75
commit
7d0fc373ab
@ -41,7 +41,7 @@ define(function(require) {
|
||||
return;
|
||||
}
|
||||
|
||||
var id = keys.keyId.substring(8, keys.keyId.length);
|
||||
var id = 'whiteout_mail_' + emailDao._account.emailAddress + '_' + keys.keyId.substring(8, keys.keyId.length);
|
||||
dl.createDownload({
|
||||
content: keys.publicKeyArmored + keys.privateKeyArmored,
|
||||
filename: id + '.asc',
|
||||
|
@ -61,7 +61,7 @@ define(function(require) {
|
||||
var id = keys.keyId.substring(8, keys.keyId.length);
|
||||
dl.createDownload({
|
||||
content: keys.publicKeyArmored + keys.privateKeyArmored,
|
||||
filename: id + '.asc',
|
||||
filename: 'whiteout_mail_' + emailDao._account.emailAddress + '_' + id + '.asc',
|
||||
contentType: 'text/plain'
|
||||
}, onSave);
|
||||
});
|
||||
|
@ -71,7 +71,7 @@ define(function(require) {
|
||||
keyId: dummyKeyId
|
||||
});
|
||||
createDownloadMock.withArgs(sinon.match(function(arg) {
|
||||
return arg.content === 'ab' && arg.filename === expectedKeyId + '.asc' && arg.contentType === 'text/plain';
|
||||
return arg.content === 'ab' && arg.filename === 'whiteout_mail_' + emailAddress + '_' + expectedKeyId + '.asc' && arg.contentType === 'text/plain';
|
||||
})).yields();
|
||||
scope.onError = function() {
|
||||
expect(cryptoMock.exportKeys.calledOnce).to.be.true;
|
||||
@ -100,9 +100,7 @@ define(function(require) {
|
||||
privateKeyArmored: 'b',
|
||||
keyId: dummyKeyId
|
||||
});
|
||||
createDownloadMock.withArgs(sinon.match(function(arg) {
|
||||
return arg.content === 'ab' && arg.filename === expectedKeyId + '.asc' && arg.contentType === 'text/plain';
|
||||
})).yields(new Error('asdasd'));
|
||||
createDownloadMock.withArgs().yields(new Error('asdasd'));
|
||||
scope.onError = function() {
|
||||
expect(cryptoMock.exportKeys.calledOnce).to.be.true;
|
||||
expect(dl.createDownload.calledOnce).to.be.true;
|
||||
|
@ -133,7 +133,7 @@ define(function(require) {
|
||||
keyId: keyId
|
||||
});
|
||||
createDownloadMock.withArgs(sinon.match(function(arg) {
|
||||
return arg.content === 'ab' && arg.filename === expectedKeyId + '.asc' && arg.contentType === 'text/plain';
|
||||
return arg.content === 'ab' && arg.filename === 'whiteout_mail_' + emailAddress + '_' + expectedKeyId + '.asc' && arg.contentType === 'text/plain';
|
||||
})).yields();
|
||||
|
||||
locationSpy = sinon.spy(location, 'path');
|
||||
|
Loading…
Reference in New Issue
Block a user