title: Error: Argument 'Ctrl' is not a function, got undefined unit testing
body: <p>I'm having a hard time figuring this out. I'm starting to build my testscript. Even though its a little late. But unit testing is a good practice. For a start I just want to test two scope model (scope.global &amp; scope.security) but I got a weird error saying my MainCtrl is not a function?</p>
  
  <pre><code>'use strict';
  
  /* Controllers */
  
  angular.module('mainCtrl', ['LocalStorageModule'])
  .controller('MainCtrl', ['$scope' ,'$rootScope', '$location', 'Api', 'Security', 'Utils', 'localStorageService',function (scope, rootScope, location, Api, Security, Utils, session) {
      console.log('main js loaded');
      // $scope.main = {};
      scope.global = {};
      scope.security = Security;
  
      ....
  }]);
  </code></pre>
  
  <p>My controllerSpec.js</p>
  
  <pre><code>describe('controllers MainCtrl', function(){
  
  beforeEach(function(){
  module('Services.api'),
  module('LocalStorageModule')
  });
  
  describe('MainCtrl', function() {
  
  var scope, api, security, session;
  beforeEach(inject(function($rootScope, $controller ,$location, Api, localStorageService){
      scope = $rootScope.$new();
      $location = $location;
  
      $controller("MainCtrl", {
          $scope : scope,
      localStorageService : localStorageService,
          Api : Api
      });
  }));
  
  it('should create "usertype" model with empty list', function(){
      expect(scope.global).toBe(undefined);   
  });
    });
  });
  </code></pre>
  
  <p>Error result from above code:</p>
  
  <pre><code>Chrome 24.0 (Linux) controllers MainCtrl MainCtrl should create "usertype" model with empty list FAILED
  Error: Argument 'MainCtrl' is not a function, got undefined
  </code></pre>
  
  <p>I've tested my webapp on a browser and it doesn't encounter this MainCtrl is not function.
  Please help. </p>