Skip to content
Myr

spec.plugins.js

This file

Path

spec/spec.plugins.js

30 lines · 679 bytes · JavaScript

Last changed by

Fixing more specsvisionmediabefore adoption3a90a78

History of this file

Take it

Started Pluginvisionmediabefore adoption8158a3d

line 1why, one step back
1

CSSVariables -> CSSColors examplevisionmediabefore adoption5c7341c

line 2why, one step back
2CSSColors = Plugin.extend({

Started Pluginvisionmediabefore adoption8158a3d

line 3why, one step back
3 on: {

e -> eventvisionmediabefore adoption60b4571

lines 4–6why, one step back
4 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 back
7 }
8 }9})1011describe 'Express'12 describe 'use()'13 before_each14 reset()

CSSVariables -> CSSColors examplevisionmediabefore adoption5c7341c

line 15why, one step back
15 use(CSSColors)

Started Pluginvisionmediabefore adoption8158a3d

lines 16–18why, one step back
16 end
17 18 describe 'events'

Added Event data arg specvisionmediabefore adoption3d4d62a

line 19why, one step back
19 describe 'response'

Started Pluginvisionmediabefore adoption8158a3d

lines 20–21why, one step back
20 it 'should be triggered before headers and body are sent'
21 get('/style.css', function(){

Fixing more specsvisionmediabefore adoption3a90a78

line 22why, one step back
22 this.contentType('css')

Started Pluginvisionmediabefore adoption8158a3d

lines 23–30why, one step back
23 return 'body { color: black; }'
24 })25 get('/style.css').body.should.eql 'body { color: #000; }'26 end27 end28 end29 end30end