Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
Fix bug in reading account details (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbetta authored Oct 10, 2016
1 parent 5bdc012 commit 46a6a20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class Response {
};
}

accountInfo(ini) {
accountInfo(client) {
this.emitter.log(
`API Key: ${ini.credentials.api_key}
API Secret: ${ini.credentials.api_secret}`
`API Key: ${client.credentials.apiKey}
API Secret: ${client.credentials.apiSecret}`
);
}

Expand Down Expand Up @@ -210,9 +210,9 @@ API Secret: ${ini.credentials.api_secret}`
Remaining balance: ${message['remaining-balance']} EUR
Message price: ${message['message-price']} EUR`);
}

// JWT

generateJwt(error, token) {
this.validator.response(error, token);
this.emitter.log(`JWT: ${token}`);
Expand Down
6 changes: 3 additions & 3 deletions tests/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Response', () => {

describe('.accountInfo', () => {
it('should emit the result', sinon.test(function() {
response.accountInfo({credentials: { 'api_key' : '123', 'api_secret' : '234' }});
response.accountInfo({credentials: { 'apiKey' : '123', 'apiSecret' : '234' }});
expect(emitter.log).to.have.been.calledWith(`API Key: 123
API Secret: 234`);
}));
Expand Down Expand Up @@ -253,12 +253,12 @@ Remaining balance: 26.83440000 EUR
Message price: 0.03330000 EUR`);
});
});

describe('.generateJwt', () => {
it('should emit the result', sinon.test(function() {
response.generateJwt(null, 'a token!');
expect(emitter.log).to.have.been.calledWith('JWT: a token!');
}));
});

});

0 comments on commit 46a6a20

Please # to comment.