Created
July 21, 2011 20:43
-
-
Save radamant/1098154 to your computer and use it in GitHub Desktop.
Jasmine spec in coffeescript
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
describe 'jQuery.fn.ignoreEnter', -> | |
beforeEach -> | |
setFixtures '<input />' | |
$('input').ignoreEnter() | |
describe 'pressing enter', -> | |
event = null | |
beforeEach -> | |
event = jQuery.Event 'keypress' | |
event.which = '13' | |
spyOn event, 'preventDefault' | |
$('input').trigger(event) | |
it 'should prevent the event from bubbling', -> | |
expect(event.which).toEqual('13') | |
expect(event.preventDefault).toHaveBeenCalled() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment