diff --git a/test/run.sh b/test/run.sh old mode 100644 new mode 100755 diff --git a/test/unit/services/servicesSpec.js b/test/unit/services/servicesSpec.js index df7eed5bf..3552f725d 100644 --- a/test/unit/services/servicesSpec.js +++ b/test/unit/services/servicesSpec.js @@ -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')); + }); + }) + ); +});