title: How to test a function call inside a click event with Jasmine
body: <p>I'm fairly new with Jasmine and I'm trying to test a very simple scenario</p>
  
  <p><strong>Code under test</strong></p>
  
  <pre><code>$(function () {
  
      $("#add_distribution_list").click(function () {
          CommonNs.Utils.setWindowLocationHRef("hello.html");
      });
  
  });
  </code></pre>
  
  <p><strong>Fixture</strong></p>
  
  <pre><code>&lt;input type='button' value='Add' id='add_distribution_list'/&gt;
  </code></pre>
  
  <p><strong>Test</strong></p>
  
  <pre><code>describe("Distribution List Page", function () {
      beforeEach(function(){
          loadFixtures('button.html');
          spyOn(CommonNs.Utils, 'setWindowLocationHRef');
      });
  
      it("button redirects to action2", function () {
          $('#add_distribution_list').click();
          expect( CommonNs.Utils.setWindowLocationHRef).toHaveBeenCalled();
      });
  });
  </code></pre>
  
  <p><strong>Result</strong></p>
  
  <pre><code>Expected spy setWindowLocationHRef to have been called.
  </code></pre>
  
  <p>My SpecRunner.html imports jquery, jasmine-jquery, and the utility file in which CommonNs.Utils lives.</p>
  
  <p>How can I assert that the method on CommonNs.Utils has been called?</p>