diff options
author | Ariel Flesler <aflesler@gmail.com> | 2009-09-14 22:34:04 +0000 |
---|---|---|
committer | Ariel Flesler <aflesler@gmail.com> | 2009-09-14 22:34:04 +0000 |
commit | a2731202917f8e90cad94ee574241d1626dc7fb6 (patch) | |
tree | 6a371579cc9792809fa90f45faafeedcc19545ff /test/unit/data.js | |
parent | 173c1477ae6efc4c2eeb7131ba0646c4e1323975 (diff) | |
download | jquery-a2731202917f8e90cad94ee574241d1626dc7fb6.tar.gz jquery-a2731202917f8e90cad94ee574241d1626dc7fb6.zip |
jquery data: closes #5224. Exposing the expando.
Diffstat (limited to 'test/unit/data.js')
-rw-r--r-- | test/unit/data.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/data.js b/test/unit/data.js index 6b79da2d5..46e46ed5a 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];
|