Permalink
Browse files

upgrade grunt-junit to support redirects in 1.8

  • Loading branch information...
1 parent fca0afe commit 3ba8490de2f8cad1d062c22eac405b7bbb1a782b @johnbender johnbender committed Jan 29, 2013
Showing with 46 additions and 1 deletion.
  1. +1 −1 package.json
  2. +26 −0 tests/unit/navigation/navigator/index.html
  3. +19 −0 tests/unit/navigation/navigator/navigator_core.js
View
@@ -13,7 +13,7 @@
"dependencies": {
"grunt": "0.3.x",
"grunt-css": "0.2.0",
- "grunt-junit": "0.1.4",
+ "grunt-junit": "0.1.6",
"grunt-git-authors": "1.0.0",
"requirejs": "1.0.8",
"glob-whatev": "~0.1.4",
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>jQuery Mobile Navigate Method Test Suite</title>
+
+ <script src="../../../../external/requirejs/require.js"></script>
+ <script src="../../../../js/jquery.tag.inserter.js"></script>
+ <script src="../../../../tests/jquery.testHelper.js"></script>
+ <script src="../../../../external/qunit.js"></script>
+ <link rel="stylesheet" href="../../../../../external/qunit.css"/>
+ <script>
+ $.testHelper.asyncLoad([
+ [
+ "navigation/navigator",
+ "navigation/path",
+ ],
+ [ "navigator_core.js" ]
+ ], "../../../../js" );
+ </script>
+ <script src="../../swarminject.js"></script>
+</head>
+<body>
+ <div id="qunit"></div>
+</body>
+</html>
@@ -0,0 +1,19 @@
+// Check is the ?push-state=false is in the url and alter the tests accordingly
+$.testHelper.setPushState();
+
+(function( $ ) {
+ var navigator;
+
+ module( "Navigator object", {
+ setup: function() {
+ navigator = new $.mobile.Navigator( new $.mobile.History() );
+ }
+ });
+
+ test( "hash function properly deduces the hash from a new url and the absolute version", function() {
+ equal( navigator.hash("#foo", "http://example.com/"), "#foo" );
+ equal( navigator.hash("#/foo/bar", "http://example.com/"), "#/foo/bar" );
+ equal( navigator.hash("#/foo/bar?foo", "http://example.com/"), "#/foo/bar?foo" );
+ equal( navigator.hash("http://example.com/#/foo/bar?foo", "http://example.com/"), "#/foo/bar?foo" );
+ });
+})( jQuery );

0 comments on commit 3ba8490

Please sign in to comment.