Add more tests to controller

This commit is contained in:
Esteban Ordano 2014-08-28 21:06:49 -03:00
commit ac6dfc8035
3 changed files with 49 additions and 10 deletions

View file

@ -29,7 +29,7 @@ var RateService = function(request) {
that.isAvailable = true;
that.rates = rates;
that.queued.forEach(function(callback) {
setTimeout(callback, 0);
setTimeout(callback, 1);
});
});
};
@ -38,7 +38,7 @@ var RateService = function(request) {
RateService.prototype.whenAvailable = function(callback) {
if (this.isAvailable) {
setTimeout(callback, 0);
setTimeout(callback, 1);
} else {
this.queued.push(callback);
}