title: AngularJS test if $scope method has been called
body: <p>I have a method called <code>$scope.openGroupInbox()</code> which does <code>$scope.init()</code> and other stuff.
  I want to test if <code>$scope.init()</code> has been called.
  So I'm doing this:</p>
  
  <pre><code>it('call init', function () {
      $scope.openGroupInbox(3);
      expect($scope.init(3)).toHaveBeenCalled();
  });
  </code></pre>