spec.plugins.js
This file
Path
spec/spec.plugins.js
39 lines · 889 bytes · JavaScript
Last changed by
Added Event data arg specvisionmediabefore adoption3d4d62a
History of this fileTake it
Started Pluginvisionmediabefore adoption8158a3d
line 1why, one step back1CSSVariables -> CSSColors examplevisionmediabefore adoption5c7341c
line 2why, one step back2CSSColors = Plugin.extend({Started Pluginvisionmediabefore adoption8158a3d
line 3why, one step back3 on: {e -> eventvisionmediabefore adoption60b4571
lines 4–6why, one step back4 response: function(event) {5 if (event.response.headers['content-type'] == mime('css'))6 event.response.body = event.response.body.replace('black', '#000')Started Pluginvisionmediabefore adoption8158a3d
lines 7–14why, one step back7 }8 }9})1011describe 'Express'12 describe 'use()'13 before_each14 reset()CSSVariables -> CSSColors examplevisionmediabefore adoption5c7341c
line 15why, one step back15 use(CSSColors)Started Pluginvisionmediabefore adoption8158a3d
lines 16–17why, one step back16 end17 Added Event data arg specvisionmediabefore adoption3d4d62a
lines 18–26why, one step back18 describe 'Event'19 describe '#init()'20 it 'should accept arbitrary data'21 var event = new Event('foo', { bar: 'baz' })22 event.bar.should.eql 'baz'23 end24 end25 end26 Started Pluginvisionmediabefore adoption8158a3d
line 27why, one step back27 describe 'events'Added Event data arg specvisionmediabefore adoption3d4d62a
line 28why, one step back28 describe 'response'Started Pluginvisionmediabefore adoption8158a3d
lines 29–39why, one step back29 it 'should be triggered before headers and body are sent'30 get('/style.css', function(){31 contentType('css')32 return 'body { color: black; }'33 })34 get('/style.css').body.should.eql 'body { color: #000; }'35 end36 end37 end38 end39end