From 49b1b780ed926382df0c2338583a538b6706514d Mon Sep 17 00:00:00 2001 From: John Bender Date: Mon, 18 Apr 2011 21:46:46 -0700 Subject: [PATCH] test alterations for absolute navigation --- tests/unit/navigation/navigation_core.js | 2 +- tests/unit/navigation/navigation_helpers.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/unit/navigation/navigation_core.js b/tests/unit/navigation/navigation_core.js index b5d07354..a97bf3c2 100644 --- a/tests/unit/navigation/navigation_core.js +++ b/tests/unit/navigation/navigation_core.js @@ -166,7 +166,7 @@ }; test( "when loading a page where data-url is not defined on a sub element hash defaults to the url", function(){ - testDataUrlHash("#non-data-url a", /^#data-url-tests\/non-data-url.html$/); + testDataUrlHash("#non-data-url a", new RegExp("^#/tests/unit/navigation/data-url-tests/non-data-url.html$")); }); test( "data url works for nested paths", function(){ diff --git a/tests/unit/navigation/navigation_helpers.js b/tests/unit/navigation/navigation_helpers.js index b43a97eb..4f39f566 100644 --- a/tests/unit/navigation/navigation_helpers.js +++ b/tests/unit/navigation/navigation_helpers.js @@ -40,7 +40,7 @@ same( $.mobile.path.makeAbsolute("test.html"), "bar/test.html", "prefixes path with absolute base path from hash"); $.mobile.path.set("bar"); - same( $.mobile.path.makeAbsolute("test.html"), "test.html", "returns the relative path unaltered for non path hash"); + same( $.mobile.path.makeAbsolute("test.html"), "/tests/unit/navigation/test.html", "returns the absolute path unaltered ignoring non path hash"); $.mobile.path.set("bar/bing/bang"); same( $.mobile.path.makeAbsolute("?foo=bar&bak=baz"), "bar/bing/bang?foo=bar&bak=baz", "appends query string paths to current path"); @@ -59,13 +59,13 @@ var localroot = location.protocol + "//" + location.host + location.pathname, remoteroot = "http://google.com/", fakepath = "#foo/bar/baz.html", - pathWithParam = localroot + "/bar?baz=" + localroot, + pathWithParam = localroot + "bar?baz=" + localroot, localpath = localroot + fakepath, remotepath = remoteroot + fakepath; - same( $.mobile.path.clean( localpath ), fakepath, "removes location protocol, host, port, pathname from same-domain path"); + same( $.mobile.path.clean( localpath ), location.pathname + fakepath, "removes location protocol, host, and portfrom 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"); + same( $.mobile.path.clean( pathWithParam ), location.pathname + "bar?baz=" + localroot, "doesn't remove params with localroot value"); }); test( "path.stripHash is working properly", function(){