tests for data url init default

This commit is contained in:
John Bender 2011-02-26 23:27:41 -08:00
parent c828cf1f64
commit b246fb48fa
2 changed files with 13 additions and 3 deletions

View file

@ -25,7 +25,10 @@
<ol id="qunit-tests">
</ol>
<div data-role="page">
<div data-role="page" id="foo">
</div>
<div data-role="page" id="bar" data-url="bak">
</div>
</body>

View file

@ -1,7 +1,6 @@
/*
* mobile init tests
*/
(function($){
var mobilePage = undefined, mobileSelect = undefined,
libName = 'jquery.mobile.init.js',
@ -121,5 +120,13 @@
stop();
$.testHelper.reloadLib(libName);
});
});
test( "pages without a data-url attribute have it set to their id", function(){
same($("#foo").data('url'), "foo");
});
test( "pages with a data-url attribute are left with the original value", function(){
same($("#bar").data('url'), "bak");
});
});
})(jQuery);