Skip to content
Myr

Merge branch 'flash' into connect

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parents cdf49dc, 3c06c82 · Browse files · 6 files+137 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

6 files+137 added−1 removed

  • tests:+49 added−1 removed
  • other:+88 added−0 removed

6 files+137 added−1 removed

modified:lib/express/request.js+40 added
added:lib/express/utils.js+43 added
modified:support/connectnot shown

Its text is not shown, modified.

modified:test/request.test.js+32 added-1 removed
2 unmodified lines
3 * Module dependencies.4 */56var express = require('express'),7 connect = require('connect');7 connect = require('connect'),8 MemoryStore = require('connect/middleware/session/memory');910// Prevent reap timer11var memoryStore = new MemoryStore({ reapInterval: -1 });1213module.exports = {14 '#isXMLHttpRequest': function(assert){15 var app = express.createServer();16
91 unmodified lines
108 109 assert.response(app,110 { url: '/user', method: 'POST', data: 'id=1', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }},111 { body: 'user 1' });112 },113 114 '#flash()': function(assert){115 var app = express.createServer(116 connect.cookieDecoder(),117 connect.session({ store: memoryStore })118 );119120 app.get('/', function(req, res){121 assert.eql([], req.flash('info'));122 assert.eql([], req.flash('error'));123 assert.eql({}, req.flash());124 assert.eql({}, req.session.flash);125 126 assert.equal(1, req.flash('info', 'one'));127 assert.equal(2, req.flash('info', 'two'));128 assert.eql(['one', 'two'], req.flash('info'));129 assert.eql([], req.flash('info'));130131 assert.equal(1, req.flash('info', 'one'));132 assert.eql({ info: ['one'] }, req.flash());133 res.send('ok');134 });135 136 assert.response(app,137 { url: '/' },138 { body: 'ok' });139 }140};
added:test/utils.test.js+17 added
modified:.pomo+5 added
57 unmodified lines
58 complete: false59 description: 60 length: 2561 name: connect-form support for methodOverride?62- !ruby/object:Pomo::Task 63 complete: false64 description: 65 length: 2566 name: app.error() etc