aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJustin Meyer <justinbmeyer@gmail.com>2010-02-04 00:49:46 -0500
committerjeresig <jeresig@gmail.com>2010-02-04 00:49:46 -0500
commite177465a6b65aecbb87486f6243410ffabfe14b7 (patch)
tree5701145892cf804a891e1a8aac0f9d20873463d7 /test
parente7912805d6ee290071fb15fbca752e9f47fcd032 (diff)
downloadjquery-e177465a6b65aecbb87486f6243410ffabfe14b7.tar.gz
jquery-e177465a6b65aecbb87486f6243410ffabfe14b7.zip
Forgot to land Justin's tests for the event fixes.
Diffstat (limited to 'test')
-rw-r--r--test/unit/event.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/unit/event.js b/test/unit/event.js
index ed9621317..9ce6e2f6b 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -300,6 +300,24 @@ test("bind(), multi-namespaced events", function() {
jQuery("#firstp").trigger("custom");
});
+test("bind(), with same function", function() {
+ expect(2)
+
+ var count = 0 , func = function(){
+ count++;
+ };
+
+ jQuery("#liveHandlerOrder").bind("foo.bar", func).bind("foo.zar", func);
+ jQuery("#liveHandlerOrder").trigger("foo.bar");
+
+ equals(count, 1, "Verify binding function with multiple namespaces." );
+
+ jQuery("#liveHandlerOrder").unbind("foo.bar", func).unbind("foo.zar", func);
+ jQuery("#liveHandlerOrder").trigger("foo.bar");
+
+ equals(count, 1, "Verify that removing events still work." );
+});
+
test("bind(), with different this object", function() {
expect(4);
var thisObject = { myThis: true },