I have a controller which gets a value from $scope
and sends it to a different state:
controllers.controller('SearchController', ['$scope', '$state', '$stateParams',
function($scope, $state, $stateParams) {
$scope.search = function() {
$stateParams.query = $scope.keyword;
$state.go('search', $stateParams);
};
}]);
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 when($state.go('search', $stateParams)).then(called = true);
with Karma/AngularJS?