fix signin and add tests

This commit is contained in:
Manuel Araoz 2014-06-26 18:37:30 -03:00
parent 8d3d35ff83
commit 5e12523338
2 changed files with 28 additions and 5 deletions

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('SigninController', angular.module('copayApp.controllers').controller('SigninController',
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase) { function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase, backupService, notification) {
var cmp = function(o1, o2) { var cmp = function(o1, o2) {
var v1 = o1.show.toLowerCase(), var v1 = o1.show.toLowerCase(),
v2 = o2.show.toLowerCase(); v2 = o2.show.toLowerCase();

View File

@ -12,6 +12,9 @@ saveAs = function(o) {
describe("Unit: Controllers", function() { describe("Unit: Controllers", function() {
var invalidForm = {
$invalid: true
};
var scope; var scope;
@ -75,10 +78,7 @@ describe("Unit: Controllers", function() {
}); });
describe('#create', function() { describe('#create', function() {
it('should work with invalid form', function() { it('should work with invalid form', function() {
var form = { scope.create(invalidForm);
$invalid: true
};
scope.create(form);
}); });
}); });
@ -321,7 +321,30 @@ describe("Unit: Controllers", function() {
it('should exist', function() { it('should exist', function() {
should.exist(what); should.exist(what);
}); });
});
describe('Signin Controller', function() {
var what;
beforeEach(inject(function($controller, $rootScope) {
scope = $rootScope.$new();
what = $controller('SigninController', {
$scope: scope,
});
}));
it('should exist', function() {
should.exist(what);
});
describe('#open', function() {
it('should work with invalid form', function() {
scope.open(invalidForm);
});
});
describe('#join', function() {
it('should work with invalid form', function() {
scope.join(invalidForm);
});
});
}); });
}); });