Skip to content
Myr

spec.plugins.js

This file

Path

spec/spec.plugins.js

41 lines · 905 bytes · JavaScript

Last changed by

mime() is no longer global. Renamed to exports.type()visionmediabefore adoption2a4f352

History of this file

Take it

The walk stopped after 200 commits: lines older than 0f3a764 point at it.

Evaulating routes in context to their given request instancevisionmediabefore adoption0f3a764

line 1why, one step back
1

mime() is no longer global. Renamed to exports.type()visionmediabefore adoption2a4f352

lines 2–3why, one step back
2var mime = require('express/mime')
3

Evaulating routes in context to their given request instancevisionmediabefore adoption0f3a764

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

Calling Plugin.init() when availablevisionmediabefore adoption78d538a

lines 5–9why, one step back
5 extend: {
6 init: function() {7 this.initialized = true8 }9 },

Evaulating routes in context to their given request instancevisionmediabefore adoption0f3a764

lines 10–11why, one step back
10 on: {
11 response: function(event) {

mime() is no longer global. Renamed to exports.type()visionmediabefore adoption2a4f352

line 12why, one step back
12 if (event.response.headers['content-type'] == mime.type('css'))

Evaulating routes in context to their given request instancevisionmediabefore adoption0f3a764

lines 13–22why, one step back
13 event.response.body = event.response.body.replace('black', '#000')
14 }15 }16})1718describe 'Express'19 describe 'use()'20 before_each21 reset()22 use(CSSColors)

Calling Plugin.init() when availablevisionmediabefore adoption78d538a

lines 23–26why, one step back
23 end
24 25 it 'should call .init on plugins when available'26 CSSColors.initialized.should.be_true

Evaulating routes in context to their given request instancevisionmediabefore adoption0f3a764

lines 27–32why, one step back
27 end
28 29 describe 'events'30 describe 'response'31 it 'should be triggered before headers and body are sent'32 get('/style.css', function(){

Fixing more specsvisionmediabefore adoption3a90a78

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

Evaulating routes in context to their given request instancevisionmediabefore adoption0f3a764

lines 34–41why, one step back
34 return 'body { color: black; }'
35 })36 get('/style.css').body.should.eql 'body { color: #000; }'37 end38 end39 end40 end41end