title: How to assert a spy is invoked with event on click using jasmine?
body: <p>I'm writing a simple click handler and need the event passed in (like so)</p>
  
  <pre><code>Thing = function($){
  
      var MyObject = function(opts){
          this.opts = opts;
      };
  
      MyObject.prototype.createSomething = function(){
          var that = this;
          $('#some_dom_element').live('click', function(e) {
              that.doStuff(e);
          });
      };
  
      MyObject.prototype.doStuff = function(e) {
          //do some javascript stuff ...
          e.preventDefault();
      };
  
      return MyObject;
  
  }(jQuery);
  </code></pre>
  
  <p>Currently in my jasmine spec I've got something to spy on the function I expect gets invoked (but since it's called with e -not without args- my assertion is failing)</p>
  
  <pre><code>    it ("live click handler added to the dom element", function(){
          var doSpy = spyOn(sut, 'doStuff');
          sut.createSomething();
          $("#some_dom_element").trigger('click');
          expect(doSpy).toHaveBeenCalledWith();
      });
  </code></pre>
  
  <p>How can I correct this "toHaveBeenCalledWith" to work as I expect?</p>
  
  <hr>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I couldn't get the accepted answer to work as is but I was able to alter it just a little and the below is my 100% working example</p>
  
  <pre><code>    it ("should prevent default on click", function(){
          var event = {
              type: 'click',
              preventDefault: function () {}
          };
          var preventDefaultSpy = spyOn(event, 'preventDefault');
          sut.createSomething();
          $("#some_dom_element").trigger(event);
          expect(preventDefaultSpy).toHaveBeenCalledWith();
      });
  </code></pre>