title: how to use window.location in unit test?
body: <p>I am testing one controller function .I used  <code>window.location</code>  But I am not sure are the test cases need to write ?</p>
  
  <p>I write this code</p>
  
  <pre><code> $scope.abc='test1'
      var params ={name:'pqr',class:'sss'}
       var location = window.location;
          document.location = location.protocol + '//' + location.host + location.pathname + '?' +
              $.param(params);
    }
  </code></pre>
  
  <p>here is my plunker</p>
  
  <p><a href="http://plnkr.co/edit/ZEnWMOJo6qVhjntQM6RD?p=info" rel="nofollow">http://plnkr.co/edit/ZEnWMOJo6qVhjntQM6RD?p=info</a></p>
  
  <p>what are tests need to write ? how to test document.location ?
  test.js</p>
  
  <pre><code>describe('value check',function(){
    var $scope,
    ctrl,
    cntrl,
    $httpBackend;
    beforeEach(function(){
      module('app');
  
    });
  
  
  beforeEach(inject(function($rootScope,$controller) {
      $scope = $rootScope.$new();  
  
         cntrl = $controller('cntrl', {'$scope' : $scope });
  
  
  }));
  
  
  
     it("check variable", function() {
       $scope.test();
       expect($scope.abc).toEqual('test1')
    });
  
  
  })
  </code></pre>