title: testing an angular checkbox using in jasmin
body: <p>My situation is as follows:</p>
  
  <p><strong>directive</strong></p>
  
  <pre><code>scope: { foo:'=' },
  template: '&lt;input type="checkbox" ng-model="foo"/&gt;'
  </code></pre>
  
  <p><strong>parent controller</strong></p>
  
  <pre><code>$scope.foo = false;
  </code></pre>
  
  <p><strong>jasmine test</strong></p>
  
  <pre><code>var cb = iElement.find('input');
  
  $timeout(function() {  // using $timeout to ensure $digest() isn't the issue.
      cb.prop('checked',!cb.prop('checked'))
  },0);
  
  expect(cb.prop('checked')).toBe(true); // passes
  
  expect($scope.foo).toBe(true); // doesn't pass
  </code></pre>
  
  <p>My question: why doesn't $scope.foo get updated when I issue the prop('checked') even though the DOM does (as I've verified after inspecting it).</p>
  
  <p>Here is a jsbin that roughly demonstrates the problem <a href="http://jsbin.com/kapifezi/2/edit" rel="noreferrer">http://jsbin.com/kapifezi/2/edit</a></p>