Skip to content

Commit

Permalink
Merge pull request #591 from wpreul/master
Browse files Browse the repository at this point in the history
Fixing test to be isolated
  • Loading branch information
Eran Hammer committed Feb 27, 2013
2 parents 7c92aa0 + 42fc16e commit a0d89a3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/integration/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -1206,14 +1206,17 @@ describe('Response', function () {

it('returns a gzipped stream reply without a content-length header when accept-encoding is gzip', function (done) {

var tmpFile = '/tmp/test.json';
var tmpFile = '/tmp/gzipTest.json';
var output = JSON.stringify({ "x": "aaaaaaaaaaaa" });
Fs.writeFileSync(tmpFile, output);
var testStream = Fs.createReadStream(tmpFile);

server.start(function () {
var server1 = new Hapi.Server(0);
server1.route({ method: 'GET', path: '/stream/{issue?}', config: { handler: handler, cache: { mode: 'client', expiresIn: 9999 } } });

server1.start(function () {

testStream.pipe(Request.get({ uri: 'http://127.0.0.1:19798/stream/closes', headers: { 'Content-Type': 'application/json', 'accept-encoding': 'gzip' } }, function (err, res) {
testStream.pipe(Request.get({ uri: server1.settings.uri + '/stream/closes', headers: { 'Content-Type': 'application/json', 'accept-encoding': 'gzip' } }, function (err, res) {

expect(res.statusCode).to.equal(200);
expect(res.headers['Content-Length']).to.not.exist;
Expand Down

0 comments on commit a0d89a3

Please sign in to comment.