--
You received this message because you are subscribed to the Google Groups "Jasmine" group.
To post to this group, send email to jasmi...@googlegroups.com.
To unsubscribe from this group, send email to jasmine-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jasmine-js?hl=en.
Doing this is really testing jQuery, not his own code.
And jQuery is already thoroughly tested :-)
--
Julien
--
I've always done something like this:
describe("functionCalled", function() {
it("calls the click() function", function() {
var field = jQuery('#fieldId');
spyOn(field, 'click');
$ = spyOn(window, '$').andCallFake(function(selector) {
switch(selector) {
case "#fieldId":
return field;
break;
default:
return jQuery(selector);
break;
}
});
$('#fieldId').click();
expect(field.click).toHaveBeenCalled();
$ = jQuery;
});
});
Eric Anderson
AppNexus