@@ -176,6 +176,60 @@ describe('cli', function () {
176176
177177  } ) 
178178
179+   describe ( 'db.json --no-gzip=true' ,  function  ( )  { 
180+ 
181+     beforeEach ( function  ( done )  { 
182+       child  =  cli ( [ 'fixtures/seed.js' ,  '--no-gzip=true' ] ) 
183+       serverReady ( PORT ,  done ) 
184+     } ) 
185+ 
186+     it ( 'should not set Content-Encoding to gzip' ,  function  ( done )  { 
187+       var  origin  =  'http://example.com' 
188+ 
189+       request . get ( '/posts' ) 
190+         . set ( 'Origin' ,  origin ) 
191+         . expect ( 200 ) 
192+         . end ( function  ( err ,  res )  { 
193+           if  ( err )  { 
194+             done ( err ) 
195+             return 
196+           }  else  if  ( 'content-encoding'  in  res . headers )  { 
197+             done ( new  Error ( 'Content-Encoding is set to gzip' ) ) 
198+           }  else  { 
199+             done ( ) 
200+           } 
201+         } ) 
202+     } ) 
203+ 
204+   } ) 
205+ 
206+   describe ( 'db.json --no-gzip=false' ,  function  ( )  { 
207+ 
208+     beforeEach ( function  ( done )  { 
209+       child  =  cli ( [ 'fixtures/seed.js' ,  '--no-gzip=false' ] ) 
210+       serverReady ( PORT ,  done ) 
211+     } ) 
212+ 
213+     it ( 'should set Content-Encoding to gzip' ,  function  ( done )  { 
214+       var  origin  =  'http://example.com' 
215+ 
216+       request . get ( '/posts' ) 
217+         . set ( 'Origin' ,  origin ) 
218+         . expect ( 200 ) 
219+         . end ( function  ( err ,  res )  { 
220+           if  ( err )  { 
221+             done ( err ) 
222+             return 
223+           }  else  if  ( 'content-encoding'  in  res . headers )  { 
224+             done ( ) 
225+           }  else  { 
226+             done ( new  Error ( 'Content-Encoding is not set to gzip' ) ) 
227+           } 
228+         } ) 
229+     } ) 
230+ 
231+   } ) 
232+ 
179233  // FIXME test fails on OS X and maybe on Windows 
180234  // But manually updating db.json works... 
181235  if  ( os . platform ( )  ===  'linux' )  { 
0 commit comments