Skip to content
Browse files

refactored res.get() tests

  • Loading branch information...
1 parent 9fda13b commit a5be68b5b29005c070d2d9d50c2fe67dcfa66048 @tj tj committed
Showing with 6 additions and 15 deletions.
  1. +6 −15 test/res.get.js
View
21 test/res.get.js
@@ -1,23 +1,14 @@
var express = require('../')
- , request = require('./support/http');
+ , res = express.response;
describe('res', function(){
describe('.get(field)', function(){
- it('should get the response header field', function(done){
- var app = express();
-
- app.use(function(req, res){
- res.setHeader('Content-Type', 'text/x-foo');
- res.end(res.get('Content-Type'));
- });
-
- request(app)
- .get('/')
- .end(function(res){
- res.body.should.equal('text/x-foo');
- done();
- })
+ it('should get the response header field', function(){
+ res.setHeader('Content-Type', 'text/x-foo');
+ res.get('Content-Type').should.equal('text/x-foo');
+ res.get('Content-type').should.equal('text/x-foo');
+ res.get('content-type').should.equal('text/x-foo');
})
})
})

0 comments on commit a5be68b

Please sign in to comment.
Something went wrong with that request. Please try again.