diff --git a/js/controllers/copayers.js b/js/controllers/copayers.js index b14f3fd41..8aaf0fbcb 100644 --- a/js/controllers/copayers.js +++ b/js/controllers/copayers.js @@ -21,17 +21,14 @@ angular.module('copayApp.controllers').controller('CopayersController', $scope.deleteWallet = function() { var w = $rootScope.wallet; - w.disconnect(); walletFactory.delete(w.id, function() { controllerUtils.logout(); }); }; - // Cached list of copayers - $scope.copayers = $rootScope.wallet.getRegisteredPeerIds(); - $scope.copayersList = function() { - return $rootScope.wallet.getRegisteredPeerIds(); + $scope.copayers = $rootScope.wallet.getRegisteredPeerIds(); + return $scope.copayers; } $scope.isBackupReady = function(copayer) { diff --git a/test/unit/controllers/controllersSpec.js b/test/unit/controllers/controllersSpec.js index 1c464b236..abd154840 100644 --- a/test/unit/controllers/controllersSpec.js +++ b/test/unit/controllers/controllersSpec.js @@ -40,7 +40,7 @@ describe("Unit: Controllers", function() { }); - describe('Backup Controller', function() { + describe('More Controller', function() { var ctrl; beforeEach(inject(function($controller, $rootScope) { scope = $rootScope.$new(); @@ -479,7 +479,30 @@ describe("Unit: Controllers", function() { }); }); + describe('Copayers Controller', function() { + var saveDownload = null; + var ctrl; + beforeEach(inject(function($controller, $rootScope) { + scope = $rootScope.$new(); + $rootScope.wallet = new FakeWallet(walletConfig); + ctrl = $controller('CopayersController', { + $scope: scope, + $modal: {}, + }); + })); + + it('should exist', function() { + should.exist(ctrl); + }); + + it('Delete Wallet', function() { + expect(scope.wallet).not.equal(undefined); + scope.deleteWallet(); + expect(scope.wallet).equal(undefined); + }); + + }); describe('Join Controller', function() { var what; diff --git a/views/includes/peer-list.html b/views/includes/peer-list.html index a4dbbaed6..55cd63fef 100644 --- a/views/includes/peer-list.html +++ b/views/includes/peer-list.html @@ -7,7 +7,7 @@ -
+