title: How do you mock $http to give a 404?
body: <p>How do you mock <code>$http</code> so that when you call a specific URL the <code>.error</code> function is called? </p>
  
  <pre><code>beforeEach(angular.mock.inject(function ($httpBackend) {
      $httpBackend.when('GET', '/ErrorReturningURL').respond(/* report a 404 */);
  }));
  </code></pre>
  
  <p>In my unit test I will be watching for a certain function call.</p>