added unit test for path.getFilePath

This commit is contained in:
scottjehl 2011-01-26 00:02:34 -05:00
parent 85a6d878eb
commit fe994b7c0c

View file

@ -38,11 +38,17 @@
same(called, 2, "change page should be called twice");
});
test( "path.get method is working properly", function(){
same($.mobile.path.get(), window.location.hash, "get method returns location.hash");
same($.mobile.path.get( "#foo/bar/baz.html" ), "foo/bar/", "get method with hash arg returns path with no filename or hash prefix");
same($.mobile.path.get( "#foo/bar/baz.html/" ), "foo/bar/baz.html/", "last segment of hash is retained if followed by a trailing slash");
});
test( "path.getFilePath method is working properly", function(){
same($.mobile.path.getFilePath("foo.html" + "&" $.mobile.subPageUrlKey ), "foo.html", "returns path without sub page key");
});
test( "path.isExternal method is working properly", function(){
same($.mobile.path.isExternal("mailto:"), true, "mailto protocol");