test for rate service

This commit is contained in:
Esteban Ordano 2014-08-28 17:44:40 -03:00
parent da8aa18a1b
commit cf143898f9
2 changed files with 20 additions and 2 deletions

0
test/run.sh Normal file → Executable file
View File

View File

@ -79,8 +79,6 @@ describe("Unit: controllerUtils", function() {
expect($rootScope.addrInfos[0].address).to.be.equal(Waddr);;
}));
});
});
describe("Unit: Notification Service", function() {
@ -135,3 +133,23 @@ describe("Unit: uriHandler service", function() {
}).should.not.throw();
}));
});
describe('Unit: Rate Service', function() {
beforeEach(angular.mock.module('copayApp.services'));
it('should be injected correctly', inject(function(rateService) {
should.exist(rateService);
}));
it('should be possible to ask if it is available',
inject(function(rateService) {
should.exist(rateService.isAvailable);
})
);
it('should be possible to ask for conversion',
inject(function(rateService) {
rateService.whenAvailable(function() {
rateService.rates['LOL'] = 2;
(1 * 1e8).should.equal(rateService.fromFiat(2, 'LOL'));
});
})
);
});