Created
February 1, 2012 06:03
-
-
Save sleepynate/1715403 to your computer and use it in GitHub Desktop.
backbone events wat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it("derps when using a space in an event name", function() { | |
| var callback = jasmine.createSpy('-Custom Event Callback-'); | |
| obj.bind('all', callback); | |
| obj.trigger("foo bar"); | |
| expect(callback.callCount).toBe(1); | |
| expect(callback.mostRecentCall.args[0]).toBe('foo bar'); | |
| }); |
Author
Yea check out the expectation in larry's project: https://github.com/larrymyers/backbone-koans/blob/master/js/koans/aboutEvents.js#L66
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the case of
the callback will fire two times and the arguments will contain the model and changed value of each field
ie:
callback(model, name);
callback(model, location);