X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fdata.js;h=46e46ed5a79326c340b03ca90e208f9f4bd79434;hb=a2731202917f8e90cad94ee574241d1626dc7fb6;hp=6b79da2d53f8cc39cf9d615ba3686740c1aaa474;hpb=173c1477ae6efc4c2eeb7131ba0646c4e1323975;p=jquery.git diff --git a/test/unit/data.js b/test/unit/data.js index 6b79da2..46e46ed 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -1,5 +1,21 @@ module("data"); +test("expando", function(){ + expect(4); + + equals("expando" in jQuery, true, "jQuery is exposing the expando"); + + var obj = {}; + jQuery.data(obj, "foo", "bar"); + + equals(jQuery.expando in obj, true, "jQuery.data added an expando to the object"); + + var id = obj[jQuery.expando]; + equals( id in jQuery.cache, true, "jQuery.data added an entry to jQuery.cache"); + + equals( jQuery.cache[id].foo, "bar", "jQuery.data worked correctly"); +}); + test("jQuery.data", function() { expect(5); var div = jQuery("#foo")[0];