3 var express = require('../')
4 , request = require('supertest');
6 describe('req', function(){
7 describe('.xhr', function(){
10 this.app.get('/', function (req, res) {
15 it('should return true when X-Requested-With is xmlhttprequest', function(done){
18 .set('X-Requested-With', 'xmlhttprequest')
19 .expect(200, 'true', done)
22 it('should case-insensitive', function(done){
25 .set('X-Requested-With', 'XMLHttpRequest')
26 .expect(200, 'true', done)
29 it('should return false otherwise', function(done){
32 .set('X-Requested-With', 'blahblah')
33 .expect(200, 'false', done)
36 it('should return false when not present', function(done){
39 .expect(200, 'false', done)