This is a controller with a submit function:
$scope.submit = function(){
$http.post(\'/api/project\', $scope.project)
.success(function(data, stat
Move your services to their own module that have no dependency on ui.router. have your main app depend on this module. When you test don’t test the main app, test the module that has your services in it. The stateprovider won’t try to change state/route because this module knows nothing about the ui.router. This worked for me.