title: Error: Injector already created, can not register a module
body: <p>I am trying to test if <code>window.location</code> is set to a specific URL by end of the method, but I get this error: </p>
  
  <pre><code>Error: Injector already created, can not register a module!
  </code></pre>
  
  <p>The code:</p>
  
  <pre><code>describe('Home controller', function() {
  
    var $controller, $location, $window, $http, $timeout, $filter, $scope, $resource;
  
    beforeEach(module('app', function($provide) {
      $provide.value('$window', {
        location: {
          href: ''
        }
      });
    }));
  
    beforeEach(inject(function(_$controller_, _$location_, _$window_, _$rootScope_, _$http_,
      _$resource_, _$timeout_, _$filter_) {
  
      $controller = _$controller_;
      $location = _$location_;
      $window = _$window_;
      $http = _$http_;
      $timeout = _$timeout_;
      $filter = _$filter_;
      $scope = _$rootScope_.$new();
  
    }));
  
    it('check Home Ctrl', inject(function($rootScope, $httpBackend, API_URL) {
  
      var ctrlInstance = $controller('HomeCtrl', {
        $scope: $scope,
        $rootScope: $rootScope,
        $http: $http,
        $resource: $resource,
        $location: $location,
        $window: $window,
        $timeout: $timeout,
        API_URL: API_URL
      });
  
      $scope.goEditUser({
        userId: 2
      });
      expect($window.location.href).toContain('/switch-user/2');
  
  
    }));
  });
  </code></pre>
  
  <p>Why am I getting the error even when inject is called after module?</p>