Commit 7b2bdf68 authored by Evren Kutar's avatar Evren Kutar

staff controller name fix

staff controller test file
parent 0605cce7
......@@ -68,7 +68,7 @@ app.config(['$routeProvider', function ($routeProvider) {
})
.when('/staff/add', {
templateUrl: 'components/staff/staff_add_template.html',
controller: 'StaffCtrl',
controller: 'StaffAddEditCtrl',
resolve: {
loadMyCtrl: ['$ocLazyLoad', function ($ocLazyLoad) {
return $ocLazyLoad.load('components/staff/staff_controller.js');
......
......@@ -8,7 +8,7 @@
'use strict';
var staff = angular.module('zaerp.staff.add',['ngRoute','schemaForm', 'formService']);
var staff = angular.module('zaerp.staff',['ngRoute','schemaForm', 'formService']);
/**
......@@ -16,7 +16,7 @@ var staff = angular.module('zaerp.staff.add',['ngRoute','schemaForm', 'formServi
* which provide a form with form generator.
*/
staff.controller('StaffCtrl', function($scope, $http, $log, Generator, $routeParams){
staff.controller('StaffAddEditCtrl', function($scope, $http, $log, Generator, $routeParams){
Generator.get_form('add_staff', $routeParams).then(function(d){
$scope.schema = d.schema;
$scope.form = d.form;
......@@ -28,7 +28,6 @@ staff.controller('StaffCtrl', function($scope, $http, $log, Generator, $routePar
title: "Save"
}
);
});
$scope.onSubmit = function(form){
$scope.$broadcast('schemaFormValidate');
......@@ -37,5 +36,4 @@ staff.controller('StaffCtrl', function($scope, $http, $log, Generator, $routePar
$log.info($scope);
}
}
});
\ No newline at end of file
/**
* Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*/
'use strict';
describe('staff controller module', function () {
var $controller;
beforeEach(inject(function (_$controller_) {
// The injector unwraps the underscores (_) from around the parameter names when matching
$controller = _$controller_;
}));
describe('staff add controller', function () {
it('should have a scope object', inject(function () {
expect($scope).toBeDefined();
}));
it('should get form', inject(function () {
expect($scope.form).not.toBe(null);
}));
});
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment