tests for url root in params / path.clean Fixes #1039

This commit is contained in:
John Bender 2011-03-12 14:08:12 -08:00
parent 1911dba7d7
commit 129b586666

View file

@ -86,11 +86,13 @@
var localroot = location.href.split("/").slice(0, 3).join("/"),
remoteroot = "http://google.com/",
fakepath = "foo/bar/baz.html",
pathWithParam = localroot + "/bar?baz=" + localroot,
localpath = localroot + fakepath,
remotepath = remoteroot + fakepath;
same( $.mobile.path.clean( localpath ), fakepath, "removes location protocol, host, port from same-domain path");
same( $.mobile.path.clean( remotepath ), remotepath, "does nothing to an external domain path");
same( $.mobile.path.clean( pathWithParam ), "/bar?baz=" + localroot, "doesn't remove params with localroot value");
});
test( "path.stripHash is working properly", function(){
@ -242,7 +244,7 @@
function(){ $("#dup-history-second a:last").click(); },
function(){ $("#dup-history-dialog .ui-icon-delete").click(); },
function(){
// third page in the stack to account for first page being hash manipulation
same($.mobile.urlHistory.activeIndex, 3, "should be the third page in the stack");
start();