Navigation Menu

Skip to content

Commit

Permalink
Fix tests around hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Aug 15, 2012
1 parent 93b7c94 commit babc924
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/api-configuration.test.js
Expand Up @@ -320,7 +320,7 @@ suite('Configuration API', function() {
temporaryDatabase = undefined;
});

var defaultBaseHost = '127.0.0.1.xip.io:' + utils.testPort;
var defaultBaseHost = 'localhost:' + utils.testPort;

test('Get, Action=CreateDomain', function(done) {
utils
Expand Down Expand Up @@ -367,11 +367,10 @@ suite('Configuration API', function() {
setup(function() {
temporaryDatabase = utils.createTemporaryDatabase();
context = temporaryDatabase.get();
server = utils.setupServer(context);
});

teardown(function() {
server.close();
if (server) server.close();
temporaryDatabase.teardown();
temporaryDatabase = undefined;
});
Expand All @@ -393,7 +392,6 @@ suite('Configuration API', function() {

test('specified by server option', function(done) {
var baseHost = 'by.server.option';
server.close();
server = utils.setupServer(context, { baseHost: baseHost });
utils
.get('/?DomainName=companies&Action=CreateDomain&Version=2011-02-01')
Expand All @@ -408,6 +406,7 @@ suite('Configuration API', function() {

test('specified by Host header', function(done) {
var baseHost = 'by.host.header';
server = utils.setupServer(context);
utils
.get('/?DomainName=companies&Action=CreateDomain&Version=2011-02-01', {
'Host': baseHost
Expand All @@ -423,6 +422,7 @@ suite('Configuration API', function() {

test('specified by HTTP_X_FORWARDED_HOST header', function(done) {
var baseHost = 'by.forwarded.host.header';
server = utils.setupServer(context);
utils
.get('/?DomainName=companies&Action=CreateDomain&Version=2011-02-01', {
'HTTP_X_FORWARDED_HOST': baseHost
Expand All @@ -439,6 +439,7 @@ suite('Configuration API', function() {
test('HTTP_X_FORWARDED_HOST and Host header', function(done) {
var baseHost = 'by.host.header';
var baseHostForwarded = 'by.forwarded.host.header';
server = utils.setupServer(context);
utils
.get('/?DomainName=companies&Action=CreateDomain&Version=2011-02-01', {
'Host': baseHost,
Expand All @@ -454,11 +455,10 @@ suite('Configuration API', function() {
});

test('HTTP_X_FORWARDED_HOST, Host header, and server option', function(done) {
var baseHostByOption = 'by.server.option';
server.close();
server = utils.setupServer(context, { baseHost: baseHostByOption });
var baseHostByOption = 'by.server.option';
var baseHost = 'by.host.header';
var baseHostForwarded = 'by.forwarded.host.header';
server = utils.setupServer(context, { baseHost: baseHostByOption });
utils
.get('/?DomainName=companies&Action=CreateDomain&Version=2011-02-01', {
'Host': baseHost,
Expand Down

0 comments on commit babc924

Please sign in to comment.