ndler = sinon.spy();
          ajax.addEventListener('response', responseHandler);
        });

        test('calls the handler after every response', function() {
          ajax.generateRequest();
          ajax.generateRequest();

          server.respond();

          return ajax.lastRequest.completes.then(function() {
            expect(responseHandler.callCount).to.be.equal(2);
          });
        });
      });

      suite('when the response type is `json`', function() {
        setup(function() {
 