jquery data: closes #5224. Exposing the expando.
[jquery.git] / test / unit / data.js
index 6b79da2..46e46ed 100644 (file)
@@ -1,5 +1,21 @@
 module("data");\r
 \r
+test("expando", function(){\r
+       expect(4);\r
+       \r
+       equals("expando" in jQuery, true, "jQuery is exposing the expando");\r
+       \r
+       var obj = {};\r
+       jQuery.data(obj, "foo", "bar");\r
+\r
+       equals(jQuery.expando in obj, true, "jQuery.data added an expando to the object");      \r
+       \r
+       var id = obj[jQuery.expando];\r
+       equals( id in jQuery.cache, true, "jQuery.data added an entry to jQuery.cache");\r
+       \r
+       equals( jQuery.cache[id].foo, "bar", "jQuery.data worked correctly");\r
+});\r
+\r
 test("jQuery.data", function() {\r
        expect(5);\r
        var div = jQuery("#foo")[0];\r