title: Sinon to stub AngularJS service in Tests
body: <p>Instead of creating a mock service manually like:</p>
  
  <pre><code>var mockService = { GetData: function() { deferred = $q.defer(); return deferred.promise; }
  </code></pre>
  
  <p>And then adding it to my $controller injection like:</p>
  
  <pre><code>$controller('mycontroller', { $scope: scope, myService: mockService });
  </code></pre>
  
  <p>How can I stub out my real service using Sinon and inject that stubbed service where "mockService" is being injected into my controller above?  I'd like to stub out my real service in case my service methods get renamed then my controller tests will fail along with my service tests.</p>
  
  <p>Thanks in advance and I hope this makes sense.</p>