diff --git a/spec/controllerSpec.js b/spec/controllerSpec.js index c6f3475..ebc42cd 100644 --- a/spec/controllerSpec.js +++ b/spec/controllerSpec.js @@ -325,6 +325,11 @@ describe('Controladores abm vehículo', function() { $watch: function() {} }, focaAbmVehiculoService: { + getCisternas: function() { + return { + then: function() { return; } + }; + }, getVehiculo: function() { return { then: function() { return; } @@ -359,6 +364,12 @@ describe('Controladores abm vehículo', function() { $watch: function() {} }; var focaAbmVehiculoService = { + + getCisternas: function() { + return { + then: function() { return; } + }; + }, getVehiculo: function() { return { then: function() { return; } @@ -403,6 +414,13 @@ describe('Controladores abm vehículo', function() { $watch: function() {} }; var focaAbmVehiculoService = { + + getCisternas: function() { + return { + then: function() { return; } + }; + }, + getVehiculo: function() { return { then: function() { return; } @@ -452,6 +470,11 @@ describe('Controladores abm vehículo', function() { var controller = $controller('focaAbmVehiculoController', { $scope: scope, focaAbmVehiculoService: { + getCisternas: function() { + return { + then: function() { return; } + }; + }, getVehiculo: function() { return { then: function() { return; } @@ -493,6 +516,11 @@ describe('Controladores abm vehículo', function() { var controller = $controller('focaAbmVehiculoController', { $scope: scope, focaAbmVehiculoService: { + getCisternas: function() { + return { + then: function() { return; } + }; + }, getVehiculo: function() { return { then: function() { return; } @@ -536,6 +564,11 @@ describe('Controladores abm vehículo', function() { var controller = $controller('focaAbmVehiculoController', { $scope: scope, focaAbmVehiculoService: { + getCisternas: function() { + return { + then: function() { return; } + }; + }, getVehiculo: function() { return { then: function() { return; } @@ -581,6 +614,11 @@ describe('Controladores abm vehículo', function() { var controller = $controller('focaAbmVehiculoController', { $scope: scope, focaAbmVehiculoService: { + getCisternas: function() { + return { + then: function() { return; } + }; + }, getVehiculo: function() { return { then: function() { return; } @@ -602,7 +640,7 @@ describe('Controladores abm vehículo', function() { addCustomButton: function() { return; } }, $localStorage: {}, - $window: {} + $window: {}, }); //act @@ -628,7 +666,11 @@ describe('Controladores abm vehículo', function() { then: function() { return; } }; }, - getCisternas: function() { return; }, + getCisternas: function() { + return { + then: function() { return; } + }; + }, deleteCisterna: function() { return; } }; var controller = $controller('focaAbmVehiculoController', { diff --git a/src/js/controller.js b/src/js/controller.js index 198903f..2f8a1f3 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -101,7 +101,6 @@ angular.module('focaAbmVehiculo') $scope.now = new Date(); $scope.focused = 1; $scope.creando = false; - $scope.editando = false; $scope.transportistaStamp = ''; $scope.cisternas = []; $scope.cisterna = { @@ -206,7 +205,7 @@ angular.module('focaAbmVehiculo') }; $scope.guardar = function(key) { - + key = (typeof key === 'undefined') ? 13 : key; if (key === 13) {