spec.plugins.js
This file
Path
spec/spec.plugins.js
39 lines · 864 bytes · JavaScript
Last changed by
Calling Plugin.init() when availablevisionmediabefore adoption78d538a
History of this fileTake it
Started Pluginvisionmediabefore adoption8158a3d
line 1why, one step back1CSSVariables -> CSSColors examplevisionmediabefore adoption5c7341c
line 2why, one step back2CSSColors = Plugin.extend({Calling Plugin.init() when availablevisionmediabefore adoption78d538a
lines 3–7why, one step back3 extend: {4 init: function() {5 this.initialized = true6 }7 },Started Pluginvisionmediabefore adoption8158a3d
line 8why, one step back8 on: {e -> eventvisionmediabefore adoption60b4571
lines 9–11why, one step back9 response: function(event) {10 if (event.response.headers['content-type'] == mime('css'))11 event.response.body = event.response.body.replace('black', '#000')Started Pluginvisionmediabefore adoption8158a3d
lines 12–19why, one step back12 }13 }14})1516describe 'Express'17 describe 'use()'18 before_each19 reset()CSSVariables -> CSSColors examplevisionmediabefore adoption5c7341c
line 20why, one step back20 use(CSSColors)Calling Plugin.init() when availablevisionmediabefore adoption78d538a
lines 21–24why, one step back21 end22 23 it 'should call .init on plugins when available'24 CSSColors.initialized.should.be_trueStarted Pluginvisionmediabefore adoption8158a3d
lines 25–27why, one step back25 end26 27 describe 'events'Added Event data arg specvisionmediabefore adoption3d4d62a
line 28why, one step back28 describe 'response'Started Pluginvisionmediabefore adoption8158a3d
lines 29–30why, one step back29 it 'should be triggered before headers and body are sent'30 get('/style.css', function(){Fixing more specsvisionmediabefore adoption3a90a78
line 31why, one step back31 this.contentType('css')Started Pluginvisionmediabefore adoption8158a3d
lines 32–39why, one step back32 return 'body { color: black; }'33 })34 get('/style.css').body.should.eql 'body { color: #000; }'35 end36 end37 end38 end39end