Skip to content

Commit

Permalink
test: adds assertions for existance of token in signup
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-scherzinger committed Feb 2, 2017
1 parent ac088d4 commit 8dc7489
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/Account.test.js
Expand Up @@ -149,10 +149,12 @@ describe('Accounts class', () => {
url.returns(Promise.resolve('https://accounts.entrecode.de/auth/signup?clientID=rest'));
const token = sinon.stub(helper, 'superagentFormPost');
token.returns(Promise.resolve({ token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJlbnRyZWNvZGVUZXN0IiwiaWF0IjoxNDg1NzgzNTg4LCJleHAiOjQ2NDE0NTcxODgsImF1ZCI6IlRlc3QiLCJzdWIiOiJ0ZXN0QGVudHJlY29kZS5kZSJ9.Vhrq5GR2hNz-RoAhdlnIIWHelPciBPCemEa74s7cXn8' }));
accounts.tokenStore.has().should.be.false;

return accounts.signup('someone@example.com', 'suchsecurewow')
.then((tokenResponse) => {
tokenResponse.should.be.equal('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJlbnRyZWNvZGVUZXN0IiwiaWF0IjoxNDg1NzgzNTg4LCJleHAiOjQ2NDE0NTcxODgsImF1ZCI6IlRlc3QiLCJzdWIiOiJ0ZXN0QGVudHJlY29kZS5kZSJ9.Vhrq5GR2hNz-RoAhdlnIIWHelPciBPCemEa74s7cXn8');
accounts.tokenStore.has().should.be.true;
token.restore();
url.restore();
})
Expand Down

0 comments on commit 8dc7489

Please sign in to comment.