Fix qunit failure when run from https://intergration..
authorTimo Tijhof <ttijhof@wikimedia.org>
Sat, 12 May 2012 23:14:48 +0000 (01:14 +0200)
committerTimo Tijhof <ttijhof@wikimedia.org>
Sat, 12 May 2012 23:16:11 +0000 (01:16 +0200)
Change-Id: Ibc42bb34aae4af1fc472ac1f02056842d6a23f88

tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js

index 552e69e..b834aeb 100644 (file)
@@ -3,10 +3,11 @@ module( 'mediawiki.Uri', QUnit.newMwEnvironment() );
 test( '-- Initial check', function () {
        expect( 2 );
 
-       // Ensure we have a generic URI parser if not running in a browser
-       if ( !mw.Uri ) {
-               mw.Uri = mw.UriRelative( 'http://example.com/' );
-       }
+       // Ensure we have a generic mw.Uri constructor. By default mediawiki.uri,
+       // will use the currrent window ocation as base. But for testing we need
+       // to have a generic one, so that it doens't return false negatives if
+       // we run the test suite from an https server.
+       mw.Uri = mw.UriRelative( 'http://example.org/w/index.php' );
 
        ok( mw.UriRelative, 'mw.UriRelative defined' );
        ok( mw.Uri, 'mw.Uri defined' );