ct(eventFired).to.be.eq(true);
            expect(ajax.lastError).to.not.be.eq(null);
          });

          server.respond();

          return promise;
        });
      });

      suite('when handleAs parameter is `json`', function() {

        test('response type is string', function() {
          ajax.url = '/responds_to_get_with_json';
          ajax.handleAs = 'json';

          request = ajax.generateRequest();
          var promise = request.completes.then(function() {
            expect(typeof(a