From 91c7ab100df5f145c2a4a465c0cc39ee915a30b8 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 16 Jul 2014 19:00:34 -0300 Subject: [PATCH] Fixes karma tests --- js/controllers/backup.js | 2 +- js/controllers/sidebar.js | 5 +++++ test/unit/controllers/controllersSpec.js | 6 +++--- views/backup.html | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/js/controllers/backup.js b/js/controllers/backup.js index 445c8e4a9..6a986f21a 100644 --- a/js/controllers/backup.js +++ b/js/controllers/backup.js @@ -9,7 +9,7 @@ angular.module('copayApp.controllers').controller('BackupController', backupService.download(w); }; - $scope.dowloadBackup = function() { + $scope.downloadBackup = function() { var w = $rootScope.wallet; backupService.download(w); } diff --git a/js/controllers/sidebar.js b/js/controllers/sidebar.js index 38b8540c4..82b8cf191 100644 --- a/js/controllers/sidebar.js +++ b/js/controllers/sidebar.js @@ -53,6 +53,11 @@ angular.module('copayApp.controllers').controller('SidebarController', } } + // ng-repeat defined number of times instead of repeating over array? + $scope.getNumber = function(num) { + return new Array(num); + } + $http.get('https://api.github.com/repos/bitpay/copay/tags').success(function(data) { var toInt = function(s) { return parseInt(s); diff --git a/test/unit/controllers/controllersSpec.js b/test/unit/controllers/controllersSpec.js index 58ef7cc73..91ac09904 100644 --- a/test/unit/controllers/controllersSpec.js +++ b/test/unit/controllers/controllersSpec.js @@ -44,7 +44,7 @@ describe("Unit: Controllers", function() { it('Backup controller #download', function() { scope.wallet.setEnc('1234567'); expect(saveAsLastCall).equal(null); - scope.download(); + scope.downloadBackup(); expect(saveAsLastCall.size).equal(7); expect(saveAsLastCall.type).equal('text/plain;charset=utf-8'); }); @@ -220,7 +220,7 @@ describe("Unit: Controllers", function() { }); - describe("Unit: Header Controller", function() { + describe("Unit: Sidebar Controller", function() { var scope, $httpBackendOut; var GH = 'https://api.github.com/repos/bitpay/copay/tags'; beforeEach(inject(function($controller, $injector) { @@ -241,7 +241,7 @@ describe("Unit: Controllers", function() { beforeEach(inject(function($controller, $rootScope) { rootScope = $rootScope; scope = $rootScope.$new(); - headerCtrl = $controller('HeaderController', { + headerCtrl = $controller('SidebarController', { $scope: scope, }); })); diff --git a/views/backup.html b/views/backup.html index 7f0760e91..4a9a48bba 100644 --- a/views/backup.html +++ b/views/backup.html @@ -3,7 +3,7 @@

Backup

Its important to back up your wallet so that you can recover your wallet in case of disaster

- Download File + Download File