mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-22 15:14:44 +00:00
fixed up path.clean test so it passes
This commit is contained in:
parent
4c199a5ce6
commit
d08ff23765
1 changed files with 3 additions and 3 deletions
|
|
@ -83,14 +83,14 @@
|
|||
});
|
||||
|
||||
test( "path.clean is working properly", function(){
|
||||
var localroot = location.href.split("/").slice(0, 3).join("/"),
|
||||
var localroot = location.protocol + "//" + location.host + location.pathname,
|
||||
remoteroot = "http://google.com/",
|
||||
fakepath = "foo/bar/baz.html",
|
||||
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( localpath ), fakepath, "removes location protocol, host, port, pathname 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");
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue