title: Angular unit testing with Jasmine: how to remove or modify spyOn
body: <p>AngularJS v1.2.26</p>
  
  <p>Jasmine v2.2.0</p>
  
  <p>How can I change or remove the behavior of a <code>spyOn</code>? When I try to override it, I get the following error: <code>Error: getUpdate has already been spied upon</code></p>
  
  <pre><code>var data1 = 'foo';
  var data2 = 'bar';
  
  describe("a spec with a spy", function(){
  
      beforeEach(module('app'));
  
      var $q;
  
      beforeEach(inject(function(_updateService_, _$q_){
          updateService = _updateService_;
  
          //spy the results of the getUpdate()
          $q = _$q_;
          var deferred = $q.defer();
          deferred.resolve( data1 );
          spyOn(updateService, 'getUpdate').and.returnValue(deferred.promise);
  
      }));
  
      describe('and here the spy should be different', function() {
  
          it('returns a different value', function() {
  
            var deferred = $q.defer();
            deferred.resolve( data2 );
            spyOn(updateService, 'getUpdate'); //ERROR HERE
            updateService.getUpdate.and.returnValue(deferred.promise);
  
            ...
  
          });
      });
  
  ...
  </code></pre>
  
  <p>When I remove the second spyOn the test doesn't work.</p>
  
  <p>How do I do this?</p>