I found that some dependencies was obtained from a parent module.
Those dependencies were also not used.
Change-Id: Ia4bc1b39ff3871d1bfbc5178150c9b93bc91190e
Signed-off-by: Maxime Millette-Coulombe <mmcoulombe@inocybe.com>
define(['common/login/login.module', 'common/authentification/auth.services'], function(login) {
- login.register.controller('LoginCtrl', function ($cookieStore, $scope, $http, $window, Auth, $location) {
+ login.register.controller('LoginCtrl', function ($scope, $http, $window, Auth, $location) {
// default values
$scope.login = {};
$scope.login.username = "";
*/
define(['angularAMD', 'jquery', 'common/authentification/auth.services', 'ocLazyLoad'], function(ng, $) {
- var login = angular.module('app.common.login', ['ngCookies', 'app.common.auth', 'ui.router.state']);
+ var login = angular.module('app.common.login', ['app.common.auth', 'ui.router.state']);
+ login.register = login;
- login.config(function($stateProvider, $compileProvider, $controllerProvider, $provide, $httpProvider, $translateProvider) {
+ login.config(function($stateProvider, $compileProvider, $controllerProvider, $provide, $httpProvider) {
login.register = {
controller : $controllerProvider.register,
--- /dev/null
+define(['common/login/login.controller'], function() {
+ describe('Login Module', function() {
+ var scope, state, controller, AuthMock;
+
+ beforeEach(module('ui.router'));
+ beforeEach(module('app.common.login', function($provide) {
+ AuthMock = jasmine.createSpyObj('AuthMock', ['isAuthed']);
+ $provide.value('Auth', AuthMock);
+ }));
+
+ beforeEach(inject( function($rootScope, $controller, $state) {
+ scope = $rootScope.$new();
+ controller = $controller;
+ state = $state;
+ }));
+
+ it('Should load the login state', function() {
+ var stateName = 'login';
+
+ controller('LoginCtrl', {$scope: scope, $state: state});
+ expect(state.href(stateName, {})).toBe('#/login');
+ });
+ });
+});