 ajax.handleAs = 'text';

          request = ajax.generateRequest();
          var promise = request.completes.then(function() {
            expect(typeof(ajax.lastResponse)).to.be.equal('string');
          });

          expect(server.requests.length).to.be.equal(1);
          expect(server.requests[0].requestHeaders['accept']).to.be.equal(
            'text/plain');
          server.respond();

          return promise;
        });

      });

      suite('when a request fails', function() {
        tes