diff --git a/CHANGELOG b/CHANGELOG index dc1c89c..dba3771 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Fix error in event.js which prevented attaching more than one responder for an event name/element combination. [#651 state:resolved] (Rob Lineweaver) + * Do not sniff when testing for IE's proprietary mouseenter/mouseleave events support. Use more robust inference instead. (kangax) * Use `Prototype.emptyFunction` consistently throughout unit tests. [#253 state:resolved] (Michael M Slusarz, John David Dalton, kangax) diff --git a/test/unit/event_test.js b/test/unit/event_test.js index c399b88..fc6df25 100644 --- a/test/unit/event_test.js +++ b/test/unit/event_test.js @@ -109,6 +109,24 @@ new Test.Unit.Runner({ span.fire("test:somethingElseHappened"); this.assertEqual(2, count); }, + + testMultipleEventHandlersCanBeAddedAndRemovedFromAnElement: function() { + var span = $("span"), count1 = 0, count2 = 0; + var observer1 = function() { count1++ }; + var observer2 = function() { count2++ }; + + span.observe("test:somethingHappened", observer1); + span.observe("test:somethingHappened", observer2); + span.fire("test:somethingHappened"); + this.assertEqual(1, count1); + this.assertEqual(1, count2); + + span.stopObserving("test:somethingHappened", observer1); + span.stopObserving("test:somethingHappened", observer2); + span.fire("test:somethingHappened"); + this.assertEqual(1, count1); + this.assertEqual(1, count2); + }, testStopObservingWithoutArguments: function() { var span = $("span"), count = 0, observer = function() { count++ };