title: Jasmine unit-test case failing on the injection of the dependencies
body: <p>These are my controllers and services that I am trying to cover using Jasmine testing.</p>
  <p>home.controller.js</p>
  <pre><code>var home = angular.module('home',[])
  
  home.controller('home.controller', ['$scope','$location','homeService','localStorageService',function ($scope,$location,homeService,localStorageService) {
      homeService.directories(1001).then(function mySucces(_data) {
      $scope.dataHome = _data;
      }, function myError(response) {
           alert(&quot;error&quot;);
           
          });
       
       $scope.func = function(fileData) {
       localStorageService.set('fileId',fileData.id);
       console.log(fileData.id);
       $location.path(&quot;fileview&quot;);
          };
       
      }]);
  </code></pre>
  <p>home.service.js</p>
  <pre><code>var homeService = angular.module('homeService',[]); 
  
    homeService.factory('homeService',['$http', '$q', '$log','config', function ($http, $q, $log,config) {
      var serviceAPI = {};
      serviceAPI.directories = function (folderId) {
      var deferred = $q.defer();
      $http.get(config.service + &quot;/filevault-service/folders&quot;).then(function mySucces(response) {
      deferred.resolve(response.data.data);
          }, function myError(response) {
           deferred.resolve(response.status);
          });
      return deferred.promise;
      }
  
    
      return serviceAPI;
  
      }]);
  </code></pre>
  <p>Here goes my test case:</p>
  <blockquote>
  <pre><code>describe('equality', function() {
  
    var rootScope, homeService, scope, homeController, httpBackend, location, localStorageService;
  
  beforeEach(function(){
  
    module('fileVaultApp');
    
    inject(function($controller, $httpBackend, $rootScope, $location, homeService, localStorageService){
        rootScope = $rootScope;
        scope = $rootScope.$new();
        httpBackend = $httpBackend;
        homeService = homeService;
        location = $location;
        localStorageService = localStorageService;
        homeController = $controller('home.controller', { $scope: scope });
        spyOn($location, 'path');
    });
    
  });
  
  console.log(&quot;hello&quot;);     
  it('check the home controller', function() {      
        expect(1).toBe(1);      
       });
  });
  </code></pre>
  </blockquote>
  <p>The thing is that when I am removing the &quot;inject&quot; snippet, the test runs good. As soon as it is injected, the problem arises.</p>
  <p>The error has been given below:</p>
  <pre><code>PhantomJS 2.1.1 (Windows 7 0.0.0) equality check the home controller FAILED
          C:/FileVault/file-vault/filevault-ui/static/scripts/lib-min.js:4641:53
          forEach@C:/FileVault/file-vault/filevault-ui/static/scripts/lib-min.js:321:24
          loadModules@C:/FileVault/file-vault/filevault-ui/static/scripts/lib-min.js:4601:12
          createInjector@C:/FileVault/file-vault/filevault-ui/static/scripts/lib-min.js:4523:30
          workFn@C:/FileVault/file-vault/filevault-ui/static/scripts/lib-min.js:50216:60
          inject@C:/FileVault/file-vault/filevault-ui/static/scripts/lib-min.js:50196:46
          C:/FileVault/file-vault/filevault-ui/tests/test_jasmine_spec.js:7:12
  PhantomJS 2.1.1 (Windows 7 0.0.0): Executed 1 of 1 (1 FAILED) (0 secs / 0.012 secs)
  </code></pre>