As we see here in http://docs.angularjs.org/tutorial/step_07,
angular.module(\'phonecat\', []).
config([\'$routeProvider\', function($routeProvider) {
$r
Combining the two previous answers, if you want to test the router as a black box that is successfully routing where it should (not the controller ets configs in themselves), whatever the routes might be:
// assuming the usual inject beforeEach for $route etc.
var expected = {};
it('should call the right controller for /phones route', function () {
expected.controller = $route.routes['/phones'].controller;
$location.path('/phones');
$rootScope.$digest();
expect($route.current.controller).toBe(expected.controller);
});
it('should redirect to redirectUrl from any other route', function () {
expected.path = $route.routes[null].redirectTo;
$location.path('/wherever-wrong');
$rootScope.$digest();
expect($location.path()).toBe(expected.path);
});