title: Cannot read property 'href' of undefined error in angular?
body: <p>I am trying to test my router functionality .I am getting this error
  <strong>Cannot read property 'href' of undefined</strong>
   ..could you please tell me how i will remove this error</p>
  
  <p>here is my code
  <a href="http://plnkr.co/edit/mZiNteMWqS4forycMHiK?p=preview" rel="nofollow">http://plnkr.co/edit/mZiNteMWqS4forycMHiK?p=preview</a></p>
  
  <pre><code>describe('router  check', function(){
  
  
  
    describe('router check',function(){
       var view = 'partials/state1.html',
       $state;
  
       var $scope;
     beforeEach(function(){
      module('app');
     });
  
     beforeEach(inject(function($rootScope,$templateCache,$state) {
       $state=$state;
       $templateCache.put(view, '');
          }));
  
           it('should map state state1 to url /state1 ', function() {
              expect($state.href('state1', {})).to.equal('/state1');
          });
  
          it('should map /state1 route to state1 View template', function () {
              expect($state.get('state1').templateUrl).to.equal(view);
          });
  
  
    })
  </code></pre>