title: How to unit test a function in my case
body: <p>I am trying to create a unit test for the child controller
  In my child controller, I called a function in the parent</p>
  
  <p>child controller</p>
  
  <pre><code>$scope.clickMe = function(){
      $scope.parentMethod();
  })
  </code></pre>
  
  <p>Parent controller</p>
  
  <pre><code>$scope.parentMethod = function(item){
      //do something with parent
  })
  </code></pre>
  
  <p>Unit test</p>
  
  <pre><code>var childCtrl;
  
   beforeEach(module('myApp'));
      beforeEach(inject(function (_$controller_, _$rootScope_) {
          scope        = _$rootScope_.$new();
          childCtrl = _$controller_('childCtrl', {
              $scope: scope
          });
      }));
  
      describe('test parent', function() {
          it('should call parent', function() {
              $scope.clickMe();
              $httpBackend.flush();
          });
      });
  });
  </code></pre>
  
  <p>I am getting </p>
  
  <pre><code>TypeError: 'undefined' is not a function (evaluating '$scope.parentMethod()')
  </code></pre>
  
  <p>I am not sure how to fix this. Can anyone help me about it? Thanks a lot!</p>