Fix bug where keyId was undefined in verifyRemove link

This commit is contained in:
Tankred Hase
2016-06-10 13:17:28 +02:00
parent cfb4b9bab0
commit 9be7feab04
3 changed files with 13 additions and 9 deletions

View File

@@ -35,7 +35,7 @@ describe('Public Key Integration Tests', function() {
return recipient.to.address === primaryEmail;
}), sinon.match(params => {
emailParams = params;
return !!params.nonce;
return params.nonce !== undefined && params.keyId !== undefined;
}));
sinon.stub(nodemailer, 'createTransport').returns({
templateSender: () => { return sendEmailStub; }
@@ -253,18 +253,21 @@ describe('Public Key Integration Tests', function() {
yield publicKey.verify(emailParams);
emailParams = null;
yield publicKey.requestRemove({ keyId, origin });
expect(emailParams.keyId).to.exist;
expect(emailParams.nonce).to.exist;
});
it('should work for unverified key', function *() {
emailParams = null;
yield publicKey.requestRemove({ keyId, origin });
expect(emailParams.keyId).to.exist;
expect(emailParams.nonce).to.exist;
});
it('should work by email address', function *() {
emailParams = null;
yield publicKey.requestRemove({ email:primaryEmail, origin });
expect(emailParams.keyId).to.exist;
expect(emailParams.nonce).to.exist;
});