Navigation Menu

Skip to content

Commit

Permalink
Supporting XHR tests from a local server using a port other than :808…
Browse files Browse the repository at this point in the history
…0. You

will need to update your local_settings.js file.
  • Loading branch information
gleneivey committed Apr 13, 2010
1 parent 4ede858 commit 304f992
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion settings.js
Expand Up @@ -8,5 +8,6 @@

var SETTINGS = {
BASE_URI : 'file:///mnt/repos/thatcher/env-js/',
AJAX_BASE: 'http://github.com/thatcher/env-js/raw/master/'
AJAX_BASE: 'http://github.com/thatcher/env-js/raw/master/',
LOCAL_PORT: '8080'
};
5 changes: 3 additions & 2 deletions test/specs/xhr/spec.js
Expand Up @@ -35,7 +35,8 @@ test('Location', function(){
'.toString()'
);
equals(location.hash, '', '.hash');
equals(location.host, 'localhost:8080', '.host');
var port = (SETTINGS.LOCAL_PORT == "") ? "" : (":" + SETTINGS.LOCAL_PORT);
equals(location.host, 'localhost'+port, '.host');
equals(location.hostname, 'localhost', '.hostname');
ok(//this test may run in xhr or env so we allow for both paths
location.href === href ||
Expand All @@ -47,7 +48,7 @@ test('Location', function(){
location.pathname === ('/env-js/'+expected_path).replace('xhr','env'),
'.href'
);
equals(location.port, '8080', '.port');
equals(location.port, SETTINGS.LOCAL_PORT, '.port');
equals(location.protocol, 'http:', '.protocol');
equals(location.search, '', '.search');

Expand Down

0 comments on commit 304f992

Please sign in to comment.