title: How to inject factory into unit test
body: <p>I am trying to inject my <code>factory</code> into my unit test.</p>
  
  <p>I have something in my file like</p>
  
  <pre><code>//inside my 'testCtrl' I have
  
  $scope.getProduct = function() {
      //other codes..
      myFactory.getProduct()
         .then(function(obj){
             $scope.product.id = obj.id;
         })
  }
  </code></pre>
  
  <p>my factory file</p>
  
  <pre><code>angular.module('myApp').factory('myFactory', function($http, $q) {
      //codes...
  }) 
  </code></pre>
  
  <p>my test file.</p>
  
  <pre><code>describe('unit test here', function(){
      beforeEach(module('myApp'));
      beforeEach(module('myFactory'));
      beofreEach(inject(function(_$controller_, _$rootscope_) {
          scope._$rootScope.$new();
  
          testCtrl = _$controller_('testCtrl', {
              $scope:scope 
          })
      })
  
     //I got a Module 'plannerFactory' is not available error
     //How do I inject myFactory into my test file here and how do I       //use it?
  
  })
  </code></pre>
  
  <p>I have been searching on the web and couldn't find any useful info. Could anyone help me about it? Thanks a lot!</p>