3 var express
= require('../')
4 , request
= require('supertest');
6 describe('req', function(){
7 describe('.acceptsCharsets(type)', function(){
8 describe('when Accept-Charset is not present', function(){
9 it('should return true', function(done
){
12 app
.use(function(req
, res
, next
){
13 res
.end(req
.acceptsCharsets('utf-8') ? 'yes' : 'no');
22 describe('when Accept-Charset is present', function () {
23 it('should return true', function (done
) {
26 app
.use(function(req
, res
, next
){
27 res
.end(req
.acceptsCharsets('utf-8') ? 'yes' : 'no');
32 .set('Accept-Charset', 'foo, bar, utf-8')
36 it('should return false otherwise', function(done
){
39 app
.use(function(req
, res
, next
){
40 res
.end(req
.acceptsCharsets('utf-8') ? 'yes' : 'no');
45 .set('Accept-Charset', 'foo, bar')