Skip to content

Commit

Permalink
Testing for content snippet instead of size.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricemach committed Sep 28, 2011
1 parent 17635f2 commit 4480866
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/assets.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ port = 15200
t.equal 'length', res.headers['content-length'], '18059'

zappa: (t) ->
t.expect 'content-type', 'length'
t.expect 'content-type', 'snippet'
t.wait 3000

zapp = zappa port++, ->
Expand All @@ -123,10 +123,10 @@ port = 15200
c = t.client(zapp.app)
c.get '/zappa/zappa.js', (err, res) ->
t.equal 'content-type', res.headers['content-type'], 'application/javascript'
t.equal 'length', res.headers['content-length'], '5574'
t.ok 'snippet', res.body.indexOf('window.zappa = {};') > -1

'zappa (automatic)': (t) ->
t.expect 'content-type', 'length'
t.expect 'content-type', 'snippet'
t.wait 3000

zapp = zappa port++, ->
Expand All @@ -135,7 +135,7 @@ port = 15200
c = t.client(zapp.app)
c.get '/zappa/zappa.js', (err, res) ->
t.equal 'content-type', res.headers['content-type'], 'application/javascript'
t.equal 'length', res.headers['content-length'], '5574'
t.ok 'snippet', res.body.indexOf('window.zappa = {};') > -1

minify: (t) ->
t.expect 'zappa', 'client', 'shared', 'coffee', 'js'
Expand All @@ -150,7 +150,7 @@ port = 15200

c = t.client(zapp.app)
c.get '/zappa/zappa.js', (err, res) ->
t.equal 'zappa', res.headers['content-length'], '2894'
t.ok 'zappa', res.body.indexOf('window.zappa={},') > -1
c.get '/client.js', (err, res) ->
t.equal 'client', res.headers['content-length'], '42'
c.get '/shared.js', (err, res) ->
Expand Down

0 comments on commit 4480866

Please sign in to comment.