From 129b5866662181ec4f418dd1f57e60f44e3c9070 Mon Sep 17 00:00:00 2001 From: John Bender Date: Sat, 12 Mar 2011 14:08:12 -0800 Subject: [PATCH] tests for url root in params / path.clean Fixes #1039 --- tests/unit/navigation/navigation_core.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/unit/navigation/navigation_core.js b/tests/unit/navigation/navigation_core.js index c48ab2ef..032d7c24 100644 --- a/tests/unit/navigation/navigation_core.js +++ b/tests/unit/navigation/navigation_core.js @@ -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();