title: expected a spy but got undefined?
body: <p>Trying to get my head around jasmine spies, this is what my test looks like:</p>
  
  <pre><code>  $scope.switchTurns = function () {
      $scope.playerTurn = !$scope.playerTurn;
      console.log($scope.centrePileCards.length);
      if ($scope.playerTurn == 1) {
        $scope.pickCard();
      }
    }
  </code></pre>
  
  <p>My unit test looks like this:</p>
  
  <pre><code>it('should pick one card',function(){
      var controller = createController();
      spyOn(scope,'pickCard')
      scope.switchTurns();
      scope.playerTurn=1;
      expect(scope.pickCard()).toHaveBeenCalled();
  
    })
  </code></pre>
  
  <p>I am getting this error now:</p>
  
  <pre><code>Error : Expected a spy , but got undefined.
  </code></pre>
  
  <p>Suggestions?</p>