Skip to content

Instantly share code, notes, and snippets.

@bsingr
Created February 16, 2011 11:22
Show Gist options
  • Save bsingr/829229 to your computer and use it in GitHub Desktop.
Save bsingr/829229 to your computer and use it in GitHub Desktop.
bubbleinput spec
describe("event-bindings", function(){
var $sandbox;
beforeEach(function(){
$sandbox = jQuery("body").append("<div id='sandbox'></div>").find("#sandbox");
});
afterEach(function(){
$sandbox.remove();
});
it("should handle event", function(){
$sandbox.append("<div id='bubbleinput' />");
var $bubbleinput = $sandbox.find("#bubbleinput");
makeBubbleInput("#bubbleinput");
expect($bubbleinput).toHandle("click");
expect($bubbleinput).toHandleWith("click", bindEntryFocus);
});
});
describe("event-triggering", function(){
it("should trigger events", function(){
var $body = jQuery("body");
spyOnEvent($body, "click");
bindEntryFocus();
expect('click').toHaveBeenTriggeredOn($body);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment