Add tests for #908, #933.

This commit is contained in:
Brad Dunbar
2012-02-02 20:06:48 -05:00
parent db97d9933a
commit 3ef9c3a5fc
2 changed files with 9 additions and 1 deletions

View File

@@ -819,7 +819,7 @@
};
// Cached regex for cleaning leading hashes and slashes .
var routeStripper = /^[#\/]/;
var routeStripper = /^[#/]/;
// Cached regex for detecting MSIE.
var isExplorer = /msie [\w.]+/;

View File

@@ -200,4 +200,12 @@ $(document).ready(function() {
}
});
test("#933, #908 - leading slash", function() {
var history = new Backbone.History();
history.options = {root: '/root'};
equal(history.getFragment('/root/foo'), 'foo');
history.options.root = '/root/';
equal(history.getFragment('/root/foo'), 'foo');
});
});