title: Angular $httpBackend.expectGET - respond with 409 status & custom statusText
body: <p>Trying to create a $httpBackend.expectGET in a unit test to return a status of 409 and a custom statusText of 'TestPhrase'.</p>
  
  <p>Looking at the Angular docs (<a href="https://docs.angularjs.org/api/ngMock/service/%24httpBackend">https://docs.angularjs.org/api/ngMock/service/$httpBackend</a>) it gives the following example of what is returned: </p>
  
  <blockquote>
    <p>{function([status,] data[, headers, statusText]) |
    function(function(method, url, data, headers)}</p>
  </blockquote>
  
  <p>Having trouble understanding how to interpret the above example. </p>
  
  <p>My current code is:</p>
  
  <pre><code>      $httpBackend
          .expectGET('/example/url')
          .respond(function () {
            return ['409', ['TestPhrase'], {}];
          });
  </code></pre>
  
  <p>The code i'm testing is:</p>
  
  <blockquote>
  <pre><code>  $http.get('/example/url').then(function (response) {
        console.log('success, status ' + response.status);
        console.log('success, statusText ' + response.statusText);
    }, function(response) {
        console.log('error, status ' + response.status);
        console.log('error, statusText ' + response.statusText);
      }
    });
  </code></pre>
  </blockquote>
  
  <p>The output to console I am receiving from this test is:</p>
  
  <pre><code>'error, status 409'
  'error, statusText '
  </code></pre>
  
  <p>Expected output is:</p>
  
  <pre><code>'error, status 409'
  'error, statusText TestPhrase'
  </code></pre>