w new Error('Expected the request to fail!');
          }, function(error) {
            expect(error).to.be.instanceof(Error);
            expect(request.succeeded).to.be.eq(false);
            return timePasses(100);
          }).then(function() {
            expect(eventFired).to.be.eq(true);
            expect(ajax.lastError).to.not.be.eq(null);
            expect(ajax.lastError.status).to.be.eq(502);
            expect(ajax.lastError.statusText).to.be.eq("Bad Gateway");
            expect(ajax.lastErro