Test for getHistoricRate

This commit is contained in:
Matias Pando 2014-12-15 18:15:20 -03:00
commit f41d795921
2 changed files with 54 additions and 3 deletions

View file

@ -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);
});