title: testing angularjs ui-router go() method
body: <p>I have a controller which gets a value from <code>$scope</code> and sends it to a different state:</p>
  
  <pre><code>controllers.controller('SearchController', ['$scope', '$state', '$stateParams',
  function($scope, $state, $stateParams) {
      $scope.search = function() {
          $stateParams.query = $scope.keyword;
          $state.go('search', $stateParams);
      };
  }]);
  </code></pre>
  
  <p>I am unsure how to go about unit testing this search method.  How can I either verify that the go method has been called or do some sort of <code>when($state.go('search', $stateParams)).then(called = true);</code> with Karma/AngularJS?</p>