title: angularjs route unit testing
body: <p>As we see here in <a href="http://docs.angularjs.org/tutorial/step_07" rel="noreferrer">http://docs.angularjs.org/tutorial/step_07</a>,</p>
  
  <pre><code>angular.module('phonecat', []).
    config(['$routeProvider', function($routeProvider) {
    $routeProvider.
        when('/phones', {templateUrl: 'partials/phone-list.html',   controller: PhoneListCtrl}).
        when('/phones/:phoneId', {templateUrl: 'partials/phone-detail.html', controller: PhoneDetailCtrl}).
        otherwise({redirectTo: '/phones'});
  }]);
  </code></pre>
  
  <p>routing test is suggested to be done with e2e test, </p>
  
  <pre><code>  it('should redirect index.html to index.html#/phones', function() {
      browser().navigateTo('../../app/index.html');
      expect(browser().location().url()).toBe('/phones');
    });
  </code></pre>
  
  <p>However, I think the '$routeProvider' config is done with a single function, function($routeProvider), and we should be able to unit test without involvement of browser since I think routing function does not require browser DOM.</p>
  
  <p>For example,<br>
    when url is /foo, templateUrl must be /partials/foo.html and controller is FooCtrl<br>
    when url is /bar, templateUrl must be /partials/bar.html and controller is BarCtrl  </p>
  
  <p>It is a simple function IMO, and it should also be tested in a simple test, a unit test.</p>
  
  <p>I googled and searched for this $routeProvider unit test, but no luck yet.</p>
  
  <p>I think I may borrow some code from here but couldn't make it yet, <a href="https://github.com/angular/angular.js/blob/master/test/ng/routeSpec.js" rel="noreferrer">https://github.com/angular/angular.js/blob/master/test/ng/routeSpec.js</a>. </p>