Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
setup second test
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanlott committed Nov 8, 2017
1 parent 0dea05e commit 948a972
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/server/routes/coinpayments.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,31 @@ describe('#coinpayments IPN router', function() {

coinpayments.handleIPN(request, response);
});

it('should update credit if one is found', function (done) {
sandbox.restore();

const request = httpMocks.createRequest({
method: 'POST',
url: '/coinpayments'
});

request.body = mockBody({
status: 0,
currency: 'STORJ'
});

const response = httpMocks.createResponse({
req: request,
eventEmitter: EventEmitter
});

response.on('end', function () {
const data = response._getData();
console.log('got data: ', data);
expect(response.statusCode).to.be.ok;
done();
});
});
});
});

0 comments on commit 948a972

Please sign in to comment.