Test for getNumber function.

This commit is contained in:
Gustavo Cortez 2014-06-23 19:45:04 -03:00
parent 4f1fbf59df
commit ac83477a88
1 changed files with 24 additions and 0 deletions

View File

@ -55,6 +55,23 @@ describe("Unit: Controllers", function() {
});
});
describe('Setup Controller', function() {
var setupCtrl;
beforeEach(inject(function($controller, $rootScope) {
scope = $rootScope.$new();
setupCtrl = $controller('SetupController', {
$scope: scope,
});
}));
it('should return an array of n undefined elements', function() {
var n = 5;
var array = scope.getNumber(n);
expect(array.length).equal(n);
});
});
describe('Address Controller', function() {
var addressCtrl;
beforeEach(inject(function($controller, $rootScope) {
@ -212,6 +229,13 @@ describe("Unit: Controllers", function() {
scope.$apply();
});
it('should return an array of n undefined elements', function() {
$httpBackend.flush(); // need flush
var n = 5;
var array = scope.getNumber(n);
expect(array.length).equal(n);
});
});
describe('Send Controller', function() {