1 var app = require('../../examples/vhost')
2 var request = require('supertest')
4 describe('vhost', function(){
5 describe('example.com', function(){
6 describe('GET /', function(){
7 it('should say hello', function(done){
10 .set('Host', 'example.com')
11 .expect(200, /hello/i, done)
15 describe('GET /foo', function(){
16 it('should say foo', function(done){
19 .set('Host', 'example.com')
20 .expect(200, 'requested foo', done)
25 describe('foo.example.com', function(){
26 describe('GET /', function(){
27 it('should redirect to /foo', function(done){
30 .set('Host', 'foo.example.com')
31 .expect(302, /Redirecting to http:\/\/example.com:3000\/foo/, done)
36 describe('bar.example.com', function(){
37 describe('GET /', function(){
38 it('should redirect to /bar', function(done){
41 .set('Host', 'bar.example.com')
42 .expect(302, /Redirecting to http:\/\/example.com:3000\/bar/, done)