Skip to content

Commit

Permalink
Add unit test for getSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Clark committed Jun 25, 2015
1 parent 2446e2f commit 141215f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const getBalances = require('./ledger/balances');
// const getPathFind = require('./ledger/pathfind');
// const getOrders = require('./ledger/orders');
// const getOrderBook = require('./ledger/orderbook');
// const getSettings = require('./ledger/settings');
const getSettings = require('./ledger/settings');
const preparePayment = require('./transaction/payment');
const prepareTrustline = require('./transaction/trustline');
const prepareOrder = require('./transaction/order');
Expand Down Expand Up @@ -40,7 +40,7 @@ RippleAPI.prototype = {
// getPathFind,
// getOrders,
// getOrderBook,
// getSettings,
getSettings,

preparePayment,
prepareTrustline,
Expand Down
7 changes: 7 additions & 0 deletions test/api-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const accountTransactionsResponse =
require('./fixtures/account-transactions-response');
const trustlinesResponse = require('./fixtures/trustlines-response');
const walletResponse = require('./fixtures/wallet.json');
const getSettingsResponse = require('./fixtures/get-settings-response');

function checkResult(expected, done, error, response) {
if (error) {
Expand Down Expand Up @@ -124,4 +125,10 @@ describe('RippleAPI', function() {
assert.deepEqual(this.api.generateWallet(), walletResponse);
});
});

it('getSettings', function(done) {
this.api.getSettings(address,
_.partial(checkResult, getSettingsResponse, done));
});

});
9 changes: 9 additions & 0 deletions test/fixtures/get-settings-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"requireDestinationTag": true,
"disallowIncomingXRP": true,
"sequence": 23,
"emailHash": "23463B99B62A72F26ED677CC556C44E8",
"walletLocator": "00000000000000000000000000000000000000000000000000000000DEADBEEF",
"domain": "example.com",
"transferRate": 1002000000
}

0 comments on commit 141215f

Please sign in to comment.