Convert getPathFind and add unit test

This commit is contained in:
Chris Clark
2015-06-30 18:56:10 -07:00
parent 077a53475d
commit 09b10d3f2c
13 changed files with 627 additions and 159 deletions

View File

@@ -2,7 +2,7 @@
const _ = require('lodash');
const assert = require('assert-diff');
const setupAPI = require('./setup-api');
const address = require('./fixtures/addresses').ACCOUNT;
const addresses = require('./fixtures/addresses');
const hashes = require('./fixtures/hashes');
const paymentSpecification = require('./fixtures/payment-specification');
const paymentResponse = require('./fixtures/payment-response');
@@ -30,6 +30,8 @@ const getSettingsResponse = require('./fixtures/get-settings-response');
const getOrdersResponse = require('./fixtures/get-orders-response');
const getOrderBookResponse = require('./fixtures/get-orderbook-response');
const getServerInfoResponse = require('./fixtures/get-server-info-response');
const getPathFindResponse = require('./fixtures/get-pathfind-response');
const address = addresses.ACCOUNT;
function checkResult(expected, done, error, response) {
if (error) {
@@ -170,4 +172,22 @@ describe('RippleAPI', function() {
done();
});
});
it('getPathFind', function(done) {
const pathfind = {
source: {
address: address
},
destination: {
address: addresses.OTHER_ACCOUNT,
amount: {
currency: 'USD',
counterparty: addresses.ISSUER,
value: '100'
}
}
};
this.api.getPathFind(pathfind,
_.partial(checkResult, getPathFindResponse, done));
});
});