Commit 701f6c9c2e89f2a090d831fc491e2a9be4cd1685

Authored by Luigi
1 parent 107f38cfbc
Exists in master

Arreglo npm test

Showing 2 changed files with 45 additions and 4 deletions   Show diff stats
spec/controllerSpec.js
... ... @@ -325,6 +325,11 @@ describe('Controladores abm vehículo', function() {
325 325 $watch: function() {}
326 326 },
327 327 focaAbmVehiculoService: {
  328 + getCisternas: function() {
  329 + return {
  330 + then: function() { return; }
  331 + };
  332 + },
328 333 getVehiculo: function() {
329 334 return {
330 335 then: function() { return; }
... ... @@ -359,6 +364,12 @@ describe('Controladores abm vehículo', function() {
359 364 $watch: function() {}
360 365 };
361 366 var focaAbmVehiculoService = {
  367 +
  368 + getCisternas: function() {
  369 + return {
  370 + then: function() { return; }
  371 + };
  372 + },
362 373 getVehiculo: function() {
363 374 return {
364 375 then: function() { return; }
... ... @@ -403,6 +414,13 @@ describe('Controladores abm vehículo', function() {
403 414 $watch: function() {}
404 415 };
405 416 var focaAbmVehiculoService = {
  417 +
  418 + getCisternas: function() {
  419 + return {
  420 + then: function() { return; }
  421 + };
  422 + },
  423 +
406 424 getVehiculo: function() {
407 425 return {
408 426 then: function() { return; }
... ... @@ -452,6 +470,11 @@ describe('Controladores abm vehículo', function() {
452 470 var controller = $controller('focaAbmVehiculoController', {
453 471 $scope: scope,
454 472 focaAbmVehiculoService: {
  473 + getCisternas: function() {
  474 + return {
  475 + then: function() { return; }
  476 + };
  477 + },
455 478 getVehiculo: function() {
456 479 return {
457 480 then: function() { return; }
... ... @@ -493,6 +516,11 @@ describe('Controladores abm vehículo', function() {
493 516 var controller = $controller('focaAbmVehiculoController', {
494 517 $scope: scope,
495 518 focaAbmVehiculoService: {
  519 + getCisternas: function() {
  520 + return {
  521 + then: function() { return; }
  522 + };
  523 + },
496 524 getVehiculo: function() {
497 525 return {
498 526 then: function() { return; }
... ... @@ -536,6 +564,11 @@ describe('Controladores abm vehículo', function() {
536 564 var controller = $controller('focaAbmVehiculoController', {
537 565 $scope: scope,
538 566 focaAbmVehiculoService: {
  567 + getCisternas: function() {
  568 + return {
  569 + then: function() { return; }
  570 + };
  571 + },
539 572 getVehiculo: function() {
540 573 return {
541 574 then: function() { return; }
... ... @@ -581,6 +614,11 @@ describe('Controladores abm vehículo', function() {
581 614 var controller = $controller('focaAbmVehiculoController', {
582 615 $scope: scope,
583 616 focaAbmVehiculoService: {
  617 + getCisternas: function() {
  618 + return {
  619 + then: function() { return; }
  620 + };
  621 + },
584 622 getVehiculo: function() {
585 623 return {
586 624 then: function() { return; }
... ... @@ -602,7 +640,7 @@ describe('Controladores abm vehículo', function() {
602 640 addCustomButton: function() { return; }
603 641 },
604 642 $localStorage: {},
605   - $window: {}
  643 + $window: {},
606 644 });
607 645  
608 646 //act
... ... @@ -628,7 +666,11 @@ describe('Controladores abm vehículo', function() {
628 666 then: function() { return; }
629 667 };
630 668 },
631   - getCisternas: function() { return; },
  669 + getCisternas: function() {
  670 + return {
  671 + then: function() { return; }
  672 + };
  673 + },
632 674 deleteCisterna: function() { return; }
633 675 };
634 676 var controller = $controller('focaAbmVehiculoController', {
src/js/controller.js
... ... @@ -101,7 +101,6 @@ angular.module('focaAbmVehiculo')
101 101 $scope.now = new Date();
102 102 $scope.focused = 1;
103 103 $scope.creando = false;
104   - $scope.editando = false;
105 104 $scope.transportistaStamp = '';
106 105 $scope.cisternas = [];
107 106 $scope.cisterna = {
... ... @@ -206,7 +205,7 @@ angular.module('focaAbmVehiculo')
206 205 };
207 206  
208 207 $scope.guardar = function(key) {
209   -
  208 +
210 209 key = (typeof key === 'undefined') ? 13 : key;
211 210  
212 211 if (key === 13) {