more test refactoring
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 · parent a63b232 · Browse files · 1 file·+34 added−12 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+34 added−12 removed
- tests:+34 added−12 removed
Provenance
- Commit
7fd47c0- Tree
e400591- Author
Tj Holowaychuk <tj@vision-media.ca>- Committer
Tj Holowaychuk <tj@vision-media.ca>- Parent
a63b232
1 file changed+34 added−12 removed
modified:test/response.test.js+34 added-12 removed
176 unmodified lines177 });178 179 assert.response(app,180 { url: '/javascripts/jquery.js' },181+ { body: 'whatever'181- { body: 'whatever', headers: { 'Content-Disposition': 'attachment; filename="jquery.js"' }});182+ , headers: { 'Content-Disposition': 'attachment; filename="jquery.js"' }});183+184 assert.response(app,185 { url: '/style.css' },184- { body: 'some stylezzz', headers: { 'Content-Disposition': 'attachment' }});186+ { body: 'some stylezzz'187+ , headers: { 'Content-Disposition': 'attachment' }});188 },189 190 'test #redirect()': function(){191 var app = express.createServer()48 unmodified lines240 241 assert.response(app,242 { url: '/html', headers: { Accept: 'text/html,text/plain' }},243 { body: '<p>Moved Temporarily. Redirecting to <a href="http://google.com">http://google.com</a></p>' });244+245 assert.response(app,246 { url: '/', headers: { Accept: 'text/plain' }},243- { body: 'Moved Permanently. Redirecting to http://google.com', status: 301, headers: { Location: 'http://google.com' }});247+ { body: 'Moved Permanently. Redirecting to http://google.com'248+ , status: 301, headers: { Location: 'http://google.com' }});249+250 assert.response(app,251 { url: '/back', headers: { Accept: 'text/plain' }},246- { body: 'Moved Temporarily. Redirecting to /', status: 302, headers: { Location: '/', 'Content-Type': 'text/plain' }});252+ { body: 'Moved Temporarily. Redirecting to /'253+ , status: 302, headers: { Location: '/', 'Content-Type': 'text/plain' }});254+255 assert.response(app,256 { url: '/back', headers: { Referer: '/foo', Accept: 'text/plain' }},249- { body: 'Moved Temporarily. Redirecting to /foo', status: 302, headers: { Location: '/foo' }});257+ { body: 'Moved Temporarily. Redirecting to /foo'258+ , status: 302, headers: { Location: '/foo' }});259+260 assert.response(app,261 { url: '/back', headers: { Referrer: '/foo', Accept: 'text/plain' }},252- { body: 'Moved Temporarily. Redirecting to /foo', status: 302, headers: { Location: '/foo' }});262+ { body: 'Moved Temporarily. Redirecting to /foo'263+ , status: 302, headers: { Location: '/foo' }});264+265 assert.response(app,266 { url: '/home', headers: { Accept: 'text/plain' } },255- { body: 'Moved Temporarily. Redirecting to /', status: 302, headers: { Location: '/' }});267+ { body: 'Moved Temporarily. Redirecting to /'268+ , status: 302, headers: { Location: '/' }});269 270 assert.response(app2,271 { url: '/', headers: { Accept: 'text/plain' }},259- { body: 'Moved Permanently. Redirecting to http://google.com', status: 301, headers: { Location: 'http://google.com' }});272+ { body: 'Moved Permanently. Redirecting to http://google.com'273+ , status: 301, headers: { Location: 'http://google.com' }});274+275 assert.response(app2,276 { url: '/back', headers: { Accept: 'text/plain' }},262- { body: 'Moved Temporarily. Redirecting to /blog', status: 302, headers: { Location: '/blog' }});277+ { body: 'Moved Temporarily. Redirecting to /blog'278+ , status: 302, headers: { Location: '/blog' }});279+280 assert.response(app2,281 { url: '/home', headers: { Accept: 'text/plain' }},265- { body: 'Moved Temporarily. Redirecting to /blog', status: 302, headers: { Location: '/blog' }});282+ { body: 'Moved Temporarily. Redirecting to /blog'283+ , status: 302, headers: { Location: '/blog' }});284+285 assert.response(app2,286 { url: '/google', headers: { Accept: 'text/plain' }},268- { body: 'Moved Temporarily. Redirecting to http://google.com', status: 302, headers: { Location: 'http://google.com' }});287+ { body: 'Moved Temporarily. Redirecting to http://google.com'288+ , status: 302, headers: { Location: 'http://google.com' }});289+290 assert.response(app2,291 { url: '/user/12', headers: { Accept: 'text/plain' }},271- { body: 'Moved Temporarily. Redirecting to /user/12/blog', status: 302, headers: { Location: '/user/12/blog', 'X-Foo': 'bar' }});292+ { body: 'Moved Temporarily. Redirecting to /user/12/blog'293+ , status: 302, headers: { Location: '/user/12/blog', 'X-Foo': 'bar' }});294 },295 296 'test #sendfile()': function(){297 var app = express.createServer();241 unmodified lines