Test for getHistoricRate
This commit is contained in:
parent
82a26f76ea
commit
f41d795921
2 changed files with 54 additions and 3 deletions
|
|
@ -106,7 +106,10 @@ RateService.prototype.getHistoricRates = function(code, dates, cb) {
|
|||
}, function(err, res, body) {
|
||||
if (err || res.statusCode != 200 || !body) return cb(err || res);
|
||||
if (!_.isArray(body)) {
|
||||
body = [{ ts: dates[0], rate: body.rate }];
|
||||
body = [{
|
||||
ts: dates[0],
|
||||
rate: body.rate
|
||||
}];
|
||||
}
|
||||
return cb(null, body);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue