Merge pull request #246 from matiu/feature/validation-header

feature: add "is email validated" header to emailplugin responses
This commit is contained in:
Esteban Ordano 2014-11-12 15:57:53 -03:00
commit 1c7c39a104
2 changed files with 594 additions and 547 deletions

File diff suppressed because it is too large Load Diff

View File

@ -387,9 +387,12 @@ describe('emailstore test', function() {
plugin.retrieveDataByEmailAndPassphrase = sinon.stub();
plugin.retrieveDataByEmailAndPassphrase.onFirstCall().callsArgWith(3, null, 'encrypted');
response.send.onFirstCall().returnsThis();
plugin.addValidationHeader = sinon.stub().callsArg(2);
plugin.retrieve(request, response);
request.header.calledOnce.should.equal(true);
response.send.calledOnce.should.equal(true);
assert(request.header.firstCall.args[0] === 'authorization');
assert(plugin.retrieveDataByEmailAndPassphrase.firstCall.args[0] === 'email');